CompressedStack 类

定义

提供方法用于设置和捕获当前线程上的压缩堆栈。Provides methods for setting and capturing the compressed stack on the current thread. 无法继承此类。This class cannot be inherited.

public ref class CompressedStack sealed : System::Runtime::Serialization::ISerializable
public ref class CompressedStack
public sealed class CompressedStack : System.Runtime.Serialization.ISerializable
public class CompressedStack
[System.Serializable]
public sealed class CompressedStack : System.Runtime.Serialization.ISerializable
type CompressedStack = class
    interface ISerializable
type CompressedStack = class
Public NotInheritable Class CompressedStack
Implements ISerializable
Public Class CompressedStack
继承
CompressedStack
属性
实现

注解

压缩堆栈是调用堆栈上所有代码访问安全信息的精简表示形式,例如 DenyAssert 操作。The compressed stack is a compact representation of all the code access security information on the call stack, such as Deny and Assert actions. 例如,如果 Deny 操作是从当前帧向上两个堆栈帧,并且在此与当前帧之间没有其他代码访问安全性批注,则压缩堆栈只记录该信息,而无需序列化整个调用堆栈。For example, if a Deny action is two stack frames up from the current frame and there are no other code access security annotations between there and the current frame, the compressed stack records only that information, without having to serialize the entire call stack.

CompressedStack 类由 SecurityContext 类在内部使用。The CompressedStack class is used internally by the SecurityContext class. 例如,SecurityContext.Capture 方法将捕获当前调用堆栈的压缩堆栈以及模拟和区域性信息。For example, the SecurityContext.Capture method captures the compressed stack for the current call stack, along with impersonation and culture information. ExecutionContext 类依次使用 SecurityContext 类来在线程之间流动上下文,例如,在计划线程池任务时。The SecurityContext class is used in turn by the ExecutionContext class to flow context across threads, for example when scheduling thread pool tasks.

此类不用于普通的应用程序编程。This class is not used in ordinary application programming.

方法

Capture()

从当前线程捕获压缩堆栈。Captures the compressed stack from the current thread.

CreateCopy()

创建当前压缩堆栈的副本。Creates a copy of the current compressed stack.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
Finalize()

释放由当前实例所持有的资源。Releases the resources held by the current instance.

GetCompressedStack()

获取当前线程的压缩堆栈。Gets the compressed stack for the current thread.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetObjectData(SerializationInfo, StreamingContext)

用重新创建此执行上下文的实例所需的逻辑上下文信息设置 SerializationInfo 对象。Sets the SerializationInfo object with the logical context information needed to recreate an instance of this execution context.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Run(CompressedStack, ContextCallback, Object)

在当前线程上的指定压缩堆栈中运行某个方法。Runs a method in the specified compressed stack on the current thread.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于