ConditionalAttribute Constructor (String)


Initializes a new instance of the ConditionalAttribute class.

Namespace:   System.Diagnostics
Assembly:  mscorlib (in mscorlib.dll)

Public Sub New (
	conditionString As String


Type: System.String

A string that specifies the case-sensitive conditional compilation symbol that is associated with the attribute.

The following example demonstrates how to use the ConditionalAttribute constructor. This example is part of a larger example provided for the ConditionalAttribute class.

<ConditionalAttribute("CONDITION1")> _
Shared Sub Method1(x As Integer)
    Console.WriteLine("CONDITION1 is defined")
End Sub

<ConditionalAttribute("CONDITION1"), ConditionalAttribute("CONDITION2")> _
Shared Sub Method2()
    Console.WriteLine("CONDITION1 or CONDITIOIN2 is defined")
End Sub

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top