EventMappingSettings.Type 属性

定义

获取或设置自定义事件类型。

public:
 property System::String ^ Type { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("type", DefaultValue="", IsRequired=true)]
public string Type { get; set; }
[<System.Configuration.ConfigurationProperty("type", DefaultValue="", IsRequired=true)>]
member this.Type : string with get, set
Public Property Type As String

属性值

有效的类型引用或空字符串(“)。 默认值为空字符串。

属性

示例

下面的代码示例演示如何使用该 Type 属性。 该代码示例是 HealthMonitoringSection 类中的一个较大示例的一部分。

eventMappingSetting.Type = 
    "System.Web.Management.WebErrorEvent, System.Web";
eventMappingSetting.Type = _
    "System.Web.Management.WebErrorEvent, System.Web"

注解

使用此属性可指定事件的类型。 指定的类型可以是实际类类型或事件类的父类型。 如果它是空字符串(“),则不映射任何事件,并且该 EventMappingSettings 对象充当占位符。

类型引用的格式如下(括号中的项不是必需的): 命名空间TypenameAssemblyname[,] [Version=x,] [Culture=y,] [PublicKeyToken=z]。 例如“ExampleNameSpace.ExampleType, Example.Assembly, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%”

适用于

另请参阅