Table of Contents

PluginTrustContext Class

Definition

Namespace
Bodu.Globalization.Calendar.Plugins
Assembly
Bodu.Globalization.Calendar.Plugins.dll
Package
Bodu.Globalization.Calendar.Plugins 1.0.0
Source
PluginTrustContext.cs

Carries the metadata a trust policy evaluates before a plugin assembly's code is activated.

public sealed record PluginTrustContext : IEquatable<PluginTrustContext>
Inheritance
PluginTrustContext
Implements
Inherited Members
Extension Methods

Constructors

PluginTrustContext(string, string?, byte[]?, string?)

Carries the metadata a trust policy evaluates before a plugin assembly's code is activated.

public PluginTrustContext(string AssemblyName, string? AssemblyPath, byte[]? FileHash, string? PublicKeyToken = null)

Parameters

AssemblyName string

The simple name of the candidate assembly.

AssemblyPath string

The file path of the candidate assembly, or null when loaded in memory.

FileHash byte[]

The SHA-256 hash of the assembly file, or null when no file is available.

PublicKeyToken string

The strong-name public-key token as lowercase hexadecimal, or null when the assembly is not strong-named.

Properties

AssemblyName

The simple name of the candidate assembly.

public string AssemblyName { get; init; }

Property Value

string

AssemblyPath

The file path of the candidate assembly, or null when loaded in memory.

public string? AssemblyPath { get; init; }

Property Value

string

FileHash

The SHA-256 hash of the assembly file, or null when no file is available.

public byte[]? FileHash { get; init; }

Property Value

byte[]

PublicKeyToken

The strong-name public-key token as lowercase hexadecimal, or null when the assembly is not strong-named.

public string? PublicKeyToken { get; init; }

Property Value

string

Methods

Deconstruct(out string, out string?, out byte[]?, out string?)

public void Deconstruct(out string AssemblyName, out string? AssemblyPath, out byte[]? FileHash, out string? PublicKeyToken)

Parameters

AssemblyName string
AssemblyPath string
FileHash byte[]
PublicKeyToken string

Equals(PluginTrustContext?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PluginTrustContext? other)

Parameters

other PluginTrustContext

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator ==(PluginTrustContext?, PluginTrustContext?)

public static bool operator ==(PluginTrustContext? left, PluginTrustContext? right)

Parameters

left PluginTrustContext
right PluginTrustContext

Returns

bool

operator !=(PluginTrustContext?, PluginTrustContext?)

public static bool operator !=(PluginTrustContext? left, PluginTrustContext? right)

Parameters

left PluginTrustContext
right PluginTrustContext

Returns

bool

Applies to

ProductVersions
.NET8, 10