范型Activity
Activity
public sealed class GenericActivity<T> : CodeActivity
{
public InArgument<ICollection<T>> myCollection { get; set; }
protected override void Execute(CodeActivityContext context)
{
ICollection<T> list = this.myCollection.Get<ICollection<T>>(context);
foreach (T obj in list)
{
Console.WriteLine(obj.ToString());
}
}
}
使用
流程
宿主
WorkflowInvoker.Invoke(new Workflow1());
结果
本文配套源码:http://www.bianceng.net/dotnet/201208/239.htm
时间: 2024-10-27 19:22:18