public static void ShowActivityStruct(object activity)
{
if (activity is System.Workflow.ComponentModel.CompositeActivity)
{
System.Workflow.ComponentModel.CompositeActivity wxd;
wxd = (System.Workflow.ComponentModel.CompositeActivity)activity;
string s;
foreach (object temp in wxd.Activities)
{
ShowActivityStruct(temp);//递归
}
}
else
{
if (activity is System.Workflow.ComponentModel.Activity)
{
System.Workflow.ComponentModel.Activity wxd;
wxd = (System.Workflow.ComponentModel.Activity)activity;
string s;
s = string.Format("说明:{0},名称:{1},类型:{2}", wxd.Description, wxd.QualifiedName, wxd.GetType().ToString());
Console.WriteLine(s);
}
}
}
{
if (activity is System.Workflow.ComponentModel.CompositeActivity)
{
System.Workflow.ComponentModel.CompositeActivity wxd;
wxd = (System.Workflow.ComponentModel.CompositeActivity)activity;
string s;
foreach (object temp in wxd.Activities)
{
ShowActivityStruct(temp);//递归
}
}
else
{
if (activity is System.Workflow.ComponentModel.Activity)
{
System.Workflow.ComponentModel.Activity wxd;
wxd = (System.Workflow.ComponentModel.Activity)activity;
string s;
s = string.Format("说明:{0},名称:{1},类型:{2}", wxd.Description, wxd.QualifiedName, wxd.GetType().ToString());
Console.WriteLine(s);
}
}
}
调用
ShowActivityStruct(instance.GetWorkflowDefinition());