Bewerken

Delen via


IfElseActivity Constructors

Definition

Initializes a new instance of the IfElseActivity class.

Overloads

IfElseActivity()

Initializes a new instance of the IfElseActivity class.

IfElseActivity(String)

Initializes a new instance of the IfElseActivity class using the name of the activity.

IfElseActivity()

Initializes a new instance of the IfElseActivity class.

public:
 IfElseActivity();
public IfElseActivity ();
Public Sub New ()

Examples

The following code example shows how to create a new instance of the IfElseActivity class and add two IfElseBranchActivity classes to it. This code example is part of the SequentialWorkflowWithParameters SDK sample from the SequentialWorkflow.cs file. For more information, see Workflow with Parameters Sample.

internal static void SetPartitionInterval(char interval)
{
    // Valid values are 'd' (daily), 'm' (monthly), and 'y' (yearly).  The default is 'm'.
    using (SqlCommand command = new SqlCommand("dbo.SetPartitionInterval"))
    {
        command.CommandType = CommandType.StoredProcedure;
        command.Connection = new SqlConnection(connectionString);

        SqlParameter intervalParameter = new SqlParameter("@Interval", SqlDbType.Char);
        intervalParameter.SqlValue = interval;
        command.Parameters.Add(intervalParameter);
        command.Connection.Open();
        command.ExecuteNonQuery();
    }
}
Friend Shared Sub SetPartitionInterval(ByVal interval As Char)
    ' Valid values are 'd' (daily), 'm' (monthly), and 'y' (yearly).  The default is 'm'.
    Using Command As New SqlCommand("dbo.SetPartitionInterval")
        Command.CommandType = CommandType.StoredProcedure
        Command.Connection = New SqlConnection(connectionString)

        Dim intervalParameter As New SqlParameter("@Interval", SqlDbType.Char)
        intervalParameter.SqlValue = interval
        Command.Parameters.Add(intervalParameter)

        Command.Connection.Open()
        Command.ExecuteNonQuery()

    End Using

End Sub

See also

Applies to

IfElseActivity(String)

Initializes a new instance of the IfElseActivity class using the name of the activity.

public:
 IfElseActivity(System::String ^ name);
public IfElseActivity (string name);
new System.Workflow.Activities.IfElseActivity : string -> System.Workflow.Activities.IfElseActivity
Public Sub New (name As String)

Parameters

name
String

The user-defined name of the activity.

See also

Applies to