ValidationContextExtensions.LogViolation Method
Display a message of a specified kind in the Visual Studio error list. Generic version of the other Log methods.
Namespace: Microsoft.VisualStudio.ArchitectureTools.Extensibility.Uml
Assembly: Microsoft.VisualStudio.ArchitectureTools.Extensibility (in Microsoft.VisualStudio.ArchitectureTools.Extensibility.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Sub LogViolation ( _
context As ValidationContext, _
violationType As ViolationType, _
description As String, _
code As String, _
ParamArray elements As IElement() _
)
public static void LogViolation(
this ValidationContext context,
ViolationType violationType,
string description,
string code,
params IElement[] elements
)
[ExtensionAttribute]
public:
static void LogViolation(
ValidationContext^ context,
ViolationType violationType,
String^ description,
String^ code,
... array<IElement^>^ elements
)
static member LogViolation :
context:ValidationContext *
violationType:ViolationType *
description:string *
code:string *
elements:IElement[] -> unit
public static function LogViolation(
context : ValidationContext,
violationType : ViolationType,
description : String,
code : String,
... elements : IElement[]
)
Parameters
violationType
Type: Microsoft.VisualStudio.Modeling.Validation.ViolationTypeSpecify whether this is an error, warning, or information.
description
Type: System.StringMessage displayed in the error window.
code
Type: System.StringA unique identifier for this message.
elements
Type: array<Microsoft.VisualStudio.Uml.Classes.IElement[]Elements that should be selected when the user double-clicks the error message.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type ValidationContext. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
ValidationContextExtensions Class
Microsoft.VisualStudio.ArchitectureTools.Extensibility.Uml Namespace