Diagnostic.Create 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Create(DiagnosticDescriptor, Location, Object[])
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
创建一个 Diagnostic 实例。
public:
static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, ParamArray messageArgs As Object()) As Diagnostic
参数
- descriptor
- DiagnosticDescriptor
描述 DiagnosticDescriptor 诊断的
- messageArgs
- Object[]
诊断消息的参数
返回
Diagnostic 实例。
适用于
Create(DiagnosticDescriptor, Location, IEnumerable<Location>, Object[])
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
创建一个 Diagnostic 实例。
public:
static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::Location ^> ^ additionalLocations, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * seq<Microsoft.CodeAnalysis.Location> * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, additionalLocations As IEnumerable(Of Location), ParamArray messageArgs As Object()) As Diagnostic
参数
- descriptor
- DiagnosticDescriptor
描述 DiagnosticDescriptor 诊断的 。
- additionalLocations
- IEnumerable<Location>
与诊断相关的附加位置的可选集。 通常,这些是消息中引用的其他项的位置。 如果为 null, AdditionalLocations 将返回空列表。
- messageArgs
- Object[]
诊断消息的参数。
返回
Diagnostic 实例。
适用于
Create(DiagnosticDescriptor, Location, ImmutableDictionary<String,String>, Object[])
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
创建一个 Diagnostic 实例。
public:
static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, System::Collections::Immutable::ImmutableDictionary<System::String ^, System::String ^> ^ properties, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Immutable.ImmutableDictionary<string,string> properties, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Immutable.ImmutableDictionary<string,string>? properties, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * System.Collections.Immutable.ImmutableDictionary<string, string> * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, properties As ImmutableDictionary(Of String, String), ParamArray messageArgs As Object()) As Diagnostic
参数
- descriptor
- DiagnosticDescriptor
描述 DiagnosticDescriptor 诊断的 。
- properties
- ImmutableDictionary<String,String>
一组可选的名称/值对,通过这些对,创建诊断的分析器可以将更详细的信息传达给修复程序。 如果为 null, Properties 将返回 Empty。
- messageArgs
- Object[]
诊断消息的参数。
返回
Diagnostic 实例。
适用于
Create(DiagnosticDescriptor, Location, IEnumerable<Location>, ImmutableDictionary<String,String>, Object[])
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
创建一个 Diagnostic 实例。
public:
static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::Location ^> ^ additionalLocations, System::Collections::Immutable::ImmutableDictionary<System::String ^, System::String ^> ^ properties, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string> properties, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string>? properties, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * seq<Microsoft.CodeAnalysis.Location> * System.Collections.Immutable.ImmutableDictionary<string, string> * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, additionalLocations As IEnumerable(Of Location), properties As ImmutableDictionary(Of String, String), ParamArray messageArgs As Object()) As Diagnostic
参数
- descriptor
- DiagnosticDescriptor
描述 DiagnosticDescriptor 诊断的 。
- additionalLocations
- IEnumerable<Location>
与诊断相关的附加位置的可选集。 通常,这些是消息中引用的其他项的位置。 如果为 null, AdditionalLocations 将返回空列表。
- properties
- ImmutableDictionary<String,String>
一组可选的名称/值对,通过这些对,创建诊断的分析器可以将更详细的信息传达给修复程序。 如果为 null, Properties 将返回 Empty。
- messageArgs
- Object[]
诊断消息的参数。
返回
Diagnostic 实例。
适用于
Create(DiagnosticDescriptor, Location, DiagnosticSeverity, IEnumerable<Location>, ImmutableDictionary<String,String>, Object[])
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
创建一个 Diagnostic 实例。
public:
static Microsoft::CodeAnalysis::Diagnostic ^ Create(Microsoft::CodeAnalysis::DiagnosticDescriptor ^ descriptor, Microsoft::CodeAnalysis::Location ^ location, Microsoft::CodeAnalysis::DiagnosticSeverity effectiveSeverity, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::Location ^> ^ additionalLocations, System::Collections::Immutable::ImmutableDictionary<System::String ^, System::String ^> ^ properties, ... cli::array <System::Object ^> ^ messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, Microsoft.CodeAnalysis.DiagnosticSeverity effectiveSeverity, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string> properties, params object[] messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location? location, Microsoft.CodeAnalysis.DiagnosticSeverity effectiveSeverity, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties, params object?[]? messageArgs);
public static Microsoft.CodeAnalysis.Diagnostic Create (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, Microsoft.CodeAnalysis.Location location, Microsoft.CodeAnalysis.DiagnosticSeverity effectiveSeverity, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations, System.Collections.Immutable.ImmutableDictionary<string,string>? properties, params object?[] messageArgs);
static member Create : Microsoft.CodeAnalysis.DiagnosticDescriptor * Microsoft.CodeAnalysis.Location * Microsoft.CodeAnalysis.DiagnosticSeverity * seq<Microsoft.CodeAnalysis.Location> * System.Collections.Immutable.ImmutableDictionary<string, string> * obj[] -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (descriptor As DiagnosticDescriptor, location As Location, effectiveSeverity As DiagnosticSeverity, additionalLocations As IEnumerable(Of Location), properties As ImmutableDictionary(Of String, String), ParamArray messageArgs As Object()) As Diagnostic
参数
- descriptor
- DiagnosticDescriptor
描述 DiagnosticDescriptor 诊断的 。
- effectiveSeverity
- DiagnosticSeverity
诊断的有效严重性。
- additionalLocations
- IEnumerable<Location>
与诊断相关的附加位置的可选集。 通常,这些是消息中引用的其他项的位置。 如果为 null, AdditionalLocations 将返回空列表。
- properties
- ImmutableDictionary<String,String>
一组可选的名称/值对,通过这些对,创建诊断的分析器可以将更详细的信息传达给修复程序。 如果为 null, Properties 将返回 Empty。
- messageArgs
- Object[]
诊断消息的参数。
返回
Diagnostic 实例。
适用于
Create(String, String, LocalizableString, DiagnosticSeverity, DiagnosticSeverity, Boolean, Int32, LocalizableString, LocalizableString, String, Location, IEnumerable<Location>, IEnumerable<String>, ImmutableDictionary<String,String>)
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
Diagnostic创建可本地化的 实例。
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, Microsoft.CodeAnalysis.LocalizableString title = default, Microsoft.CodeAnalysis.LocalizableString description = default, string helpLink = default, Microsoft.CodeAnalysis.Location location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations = default, System.Collections.Generic.IEnumerable<string> customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string> properties = default);
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, Microsoft.CodeAnalysis.LocalizableString? title = default, Microsoft.CodeAnalysis.LocalizableString? description = default, string? helpLink = default, Microsoft.CodeAnalysis.Location? location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations = default, System.Collections.Generic.IEnumerable<string>? customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties = default);
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, Microsoft.CodeAnalysis.LocalizableString? title = default, Microsoft.CodeAnalysis.LocalizableString? description = default, string? helpLink = default, Microsoft.CodeAnalysis.Location? location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations = default, System.Collections.Generic.IEnumerable<string>? customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string>? properties = default);
static member Create : string * string * Microsoft.CodeAnalysis.LocalizableString * Microsoft.CodeAnalysis.DiagnosticSeverity * Microsoft.CodeAnalysis.DiagnosticSeverity * bool * int * Microsoft.CodeAnalysis.LocalizableString * Microsoft.CodeAnalysis.LocalizableString * string * Microsoft.CodeAnalysis.Location * seq<Microsoft.CodeAnalysis.Location> * seq<string> * System.Collections.Immutable.ImmutableDictionary<string, string> -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (id As String, category As String, message As LocalizableString, severity As DiagnosticSeverity, defaultSeverity As DiagnosticSeverity, isEnabledByDefault As Boolean, warningLevel As Integer, Optional title As LocalizableString = Nothing, Optional description As LocalizableString = Nothing, Optional helpLink As String = Nothing, Optional location As Location = Nothing, Optional additionalLocations As IEnumerable(Of Location) = Nothing, Optional customTags As IEnumerable(Of String) = Nothing, Optional properties As ImmutableDictionary(Of String, String) = Nothing) As Diagnostic
参数
- id
- String
诊断的标识符。 对于编译器生成的诊断,这是带有前缀(如“CS1001”)的数字代码。
- category
- String
诊断的类别。 对于编译器生成的诊断,类别将为“Compiler”。
- message
- LocalizableString
诊断消息文本。
- severity
- DiagnosticSeverity
诊断的有效严重性。
- defaultSeverity
- DiagnosticSeverity
诊断的默认严重性。
- isEnabledByDefault
- Boolean
如果默认启用诊断,则为 True
- title
- LocalizableString
描述诊断的可选简短可本地化标题。
- description
- LocalizableString
诊断的可选较长可本地化说明。
- helpLink
- String
一个可选超链接,提供有关诊断的更多详细信息。
- additionalLocations
- IEnumerable<Location>
与诊断相关的附加位置的可选集。 通常,这些是消息中引用的其他项的位置。 如果为 null, AdditionalLocations 将返回空列表。
- customTags
- IEnumerable<String>
诊断的一组可选自定义标记。 有关一些已知标记,请参阅 WellKnownDiagnosticTags 。 如果为 null, Microsoft.CodeAnalysis.Diagnostic.CustomTags 将返回空列表。
- properties
- ImmutableDictionary<String,String>
一组可选的名称/值对,通过这些对,创建诊断的分析器可以将更详细的信息传达给修复程序。 如果为 null, Properties 将返回 Empty。
返回
Diagnostic 实例。
适用于
Create(String, String, LocalizableString, DiagnosticSeverity, DiagnosticSeverity, Boolean, Int32, Boolean, LocalizableString, LocalizableString, String, Location, IEnumerable<Location>, IEnumerable<String>, ImmutableDictionary<String,String>)
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
- Source:
- Diagnostic.cs
Diagnostic创建可本地化的 实例。
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, bool isSuppressed, Microsoft.CodeAnalysis.LocalizableString title = default, Microsoft.CodeAnalysis.LocalizableString description = default, string helpLink = default, Microsoft.CodeAnalysis.Location location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location> additionalLocations = default, System.Collections.Generic.IEnumerable<string> customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string> properties = default);
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, bool isSuppressed, Microsoft.CodeAnalysis.LocalizableString? title = default, Microsoft.CodeAnalysis.LocalizableString? description = default, string? helpLink = default, Microsoft.CodeAnalysis.Location? location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations = default, System.Collections.Generic.IEnumerable<string>? customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string?>? properties = default);
public static Microsoft.CodeAnalysis.Diagnostic Create (string id, string category, Microsoft.CodeAnalysis.LocalizableString message, Microsoft.CodeAnalysis.DiagnosticSeverity severity, Microsoft.CodeAnalysis.DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, int warningLevel, bool isSuppressed, Microsoft.CodeAnalysis.LocalizableString? title = default, Microsoft.CodeAnalysis.LocalizableString? description = default, string? helpLink = default, Microsoft.CodeAnalysis.Location? location = default, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Location>? additionalLocations = default, System.Collections.Generic.IEnumerable<string>? customTags = default, System.Collections.Immutable.ImmutableDictionary<string,string>? properties = default);
static member Create : string * string * Microsoft.CodeAnalysis.LocalizableString * Microsoft.CodeAnalysis.DiagnosticSeverity * Microsoft.CodeAnalysis.DiagnosticSeverity * bool * int * bool * Microsoft.CodeAnalysis.LocalizableString * Microsoft.CodeAnalysis.LocalizableString * string * Microsoft.CodeAnalysis.Location * seq<Microsoft.CodeAnalysis.Location> * seq<string> * System.Collections.Immutable.ImmutableDictionary<string, string> -> Microsoft.CodeAnalysis.Diagnostic
Public Shared Function Create (id As String, category As String, message As LocalizableString, severity As DiagnosticSeverity, defaultSeverity As DiagnosticSeverity, isEnabledByDefault As Boolean, warningLevel As Integer, isSuppressed As Boolean, Optional title As LocalizableString = Nothing, Optional description As LocalizableString = Nothing, Optional helpLink As String = Nothing, Optional location As Location = Nothing, Optional additionalLocations As IEnumerable(Of Location) = Nothing, Optional customTags As IEnumerable(Of String) = Nothing, Optional properties As ImmutableDictionary(Of String, String) = Nothing) As Diagnostic
参数
- id
- String
诊断的标识符。 对于编译器生成的诊断,这是带有前缀(如“CS1001”)的数字代码。
- category
- String
诊断的类别。 对于编译器生成的诊断,类别将为“Compiler”。
- message
- LocalizableString
诊断消息文本。
- severity
- DiagnosticSeverity
诊断的有效严重性。
- defaultSeverity
- DiagnosticSeverity
诊断的默认严重性。
- isEnabledByDefault
- Boolean
如果默认启用诊断,则为 True
- isSuppressed
- Boolean
指示诊断是否由源抑制取消的标志。
- title
- LocalizableString
描述诊断的可选简短可本地化标题。
- description
- LocalizableString
诊断的可选较长可本地化说明。
- helpLink
- String
一个可选超链接,提供有关诊断的更多详细信息。
- additionalLocations
- IEnumerable<Location>
与诊断相关的附加位置的可选集。 通常,这些是消息中引用的其他项的位置。 如果为 null, AdditionalLocations 将返回空列表。
- customTags
- IEnumerable<String>
诊断的一组可选自定义标记。 有关一些已知标记,请参阅 WellKnownDiagnosticTags 。 如果为 null, Microsoft.CodeAnalysis.Diagnostic.CustomTags 将返回空列表。
- properties
- ImmutableDictionary<String,String>
一组可选的名称/值对,通过这些对,创建诊断的分析器可以将更详细的信息传达给修复程序。 如果为 null, Properties 将返回 Empty。
返回
Diagnostic 实例。