EvidenceBase Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a base class from which all objects to be used as evidence must derive.
public ref class EvidenceBase abstract
public abstract class EvidenceBase
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public abstract class EvidenceBase
type EvidenceBase = class
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type EvidenceBase = class
Public MustInherit Class EvidenceBase
- Inheritance
-
EvidenceBase
- Derived
- Attributes
Before the .NET Framework 4, almost any object could be used as an evidence object if the hosting code wanted to apply it as evidence. For example, some .NET Framework code recognized System.Uri objects as evidence. The common language runtime (CLR) considered evidence objects as System.Object references, and did not apply any type safety to them.
This presented a problem because there were implicit restrictions on which types could be used as evidence objects. Specifically, any object used as evidence had to be serializable and could not be null
. If these requirements were not met, the CLR threw an exception whenever an operation that required one of these assumptions was performed.
The EvidenceBase class, which all evidence objects must derive from, was introduced in the .NET Framework 4 to enable constraints on the types of objects that can be used as evidence and to provide the ability to add new features and requirements to all evidence objects. The EvidenceBase class ensures, upon instantiation, that the evidence object is serializable. In addition, it enables new evidence requirements to be created by adding new default implementations to the base class.
All the types used by the CLR as evidence objects have been updated in the .NET Framework 4 to derive from EvidenceBase.
Evidence |
Initializes a new instance of the EvidenceBase class. |
Clone() |
Creates a new object that is a complete copy of the current instance. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Продукт | Версії |
---|---|
.NET | 6 (package-provided), 6, 7, 8, 9 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5 |
Відгук про .NET
.NET – це проект із відкритим кодом. Виберіть посилання, щоб надати відгук: