范型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()); | 结果 | | 本文示例源代码或素材下载 (责任编辑:admin) |