IfElseActivity 构造函数

定义

初始化 IfElseActivity 类的新实例。

重载

IfElseActivity()

初始化 IfElseActivity 类的新实例。

IfElseActivity(String)

使用活动名初始化 IfElseActivity 类的新实例。

IfElseActivity()

初始化 IfElseActivity 类的新实例。

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

示例

下面的代码示例演示如何创建 IfElseActivity 类的新实例,并向其中添加两个 IfElseBranchActivity 类。 此代码示例摘自 SequentialWorkflow.cs 文件中的“SequentialWorkflowWithParameters”SDK 示例。 有关详细信息,请参阅 包含参数的工作流示例

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

另请参阅

适用于

IfElseActivity(String)

使用活动名初始化 IfElseActivity 类的新实例。

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)

参数

name
String

活动的用户定义名称。

另请参阅

适用于