IfElseBranchActivity 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 IfElseBranchActivity 类的新实例。
重载
IfElseBranchActivity() |
初始化 IfElseBranchActivity 类的新实例。 |
IfElseBranchActivity(String) |
使用活动名初始化 IfElseBranchActivity 类的新实例。 |
IfElseBranchActivity()
初始化 IfElseBranchActivity 类的新实例。
public:
IfElseBranchActivity();
public IfElseBranchActivity ();
Public Sub New ()
示例
下面的代码示例演示如何创建 IfElseBranchActivity 类的两个新实例。 此代码示例摘自 PurchaseOrder.cs 文件中的“补偿”SDK 示例。 有关详细信息,请参阅 “使用补偿”。
public void SaveLayout()
{
using (XmlWriter writer = XmlWriter.Create("wfInstanceId.designer.xml"))
{
IList layoutSaveErrors = new ArrayList() as IList;
IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
ActivityDesigner rootDesigner = host.GetDesigner(host.RootComponent) as ActivityDesigner;
this.SaveDesignerLayout(writer, rootDesigner, out layoutSaveErrors);
if (layoutSaveErrors.Count > 0)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder("Errors:\r\n");
foreach (WorkflowMarkupSerializationException error in layoutSaveErrors)
{
sb.Append(error.Message + "\r\n");
}
MessageBox.Show(sb.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
Public Sub SaveLayout()
Using writer As XmlWriter = XmlWriter.Create("wfInstanceId.designer.xml")
Dim layoutSaveErrors As IList = CType(New ArrayList(), IList)
Dim host As IDesignerHost = CType(GetService(GetType(IDesignerHost)), IDesignerHost)
Dim rootDesigner As ActivityDesigner = CType(host.GetDesigner(host.RootComponent), ActivityDesigner)
Me.SaveDesignerLayout(writer, rootDesigner, layoutSaveErrors)
If layoutSaveErrors.Count > 0 Then
Dim sb As New System.Text.StringBuilder("Errors:\r\n")
For Each errorMessage As WorkflowMarkupSerializationException In layoutSaveErrors
sb.Append(errorMessage.Message + "\r\n")
Next
MessageBox.Show(sb.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Using
End Sub
适用于
IfElseBranchActivity(String)
使用活动名初始化 IfElseBranchActivity 类的新实例。
public:
IfElseBranchActivity(System::String ^ name);
public IfElseBranchActivity (string name);
new System.Workflow.Activities.IfElseBranchActivity : string -> System.Workflow.Activities.IfElseBranchActivity
Public Sub New (name As String)
参数
- name
- String
活动的用户定义名称。