本文整理汇总了C#中Utilities.CreateWorkflow方法的典型用法代码示例。如果您正苦于以下问题:C# Utilities.CreateWorkflow方法的具体用法?C# Utilities.CreateWorkflow怎么用?C# Utilities.CreateWorkflow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities.CreateWorkflow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Manager
/// <summary>
/// Constructor
/// </summary>
/// <param name="Mappings">The mappings.</param>
/// <param name="Services">The services.</param>
/// <param name="Modules">The workflow modules.</param>
/// <param name="WorkflowManager">The workflow manager.</param>
public Manager(IEnumerable<IAPIMapping> Mappings, IEnumerable<IService> Services, IEnumerable<IWorkflowModule> Modules, Utilities.Workflow.Manager.Manager WorkflowManager)
{
Contract.Requires<ArgumentNullException>(Mappings != null);
Contract.Requires<ArgumentNullException>(Services != null);
Contract.Requires<ArgumentNullException>(Modules != null);
Contract.Requires<ArgumentNullException>(WorkflowManager != null);
this.WorkflowManager = WorkflowManager;
this.Services = new Dictionary<int, ServiceHolder>();
this.Mappings = new Dictionary<int, MappingHolder>();
if (Mappings == null)
return;
foreach (IAPIMapping Mapping in Mappings)
{
foreach (int Version in Mapping.Versions)
{
if (!this.Mappings.ContainsKey(Version))
this.Mappings.Add(Version, new MappingHolder());
this.Mappings[Version].Mappings.Add(Mapping.Name, Mapping);
}
}
if (Services == null)
return;
foreach (IService Service in Services)
{
foreach (int Version in Service.Versions)
{
if (!this.Services.ContainsKey(Version))
this.Services.Add(Version, new ServiceHolder());
this.Services[Version].Services.Add(Service.Name, Service);
}
}
if (AppDomain.CurrentDomain.GetAssemblies()
.Where(x => !x.FullName.Contains("vshost32") && !x.IsDynamic && !string.IsNullOrEmpty(x.Location))
.Any(x => new System.IO.FileInfo(x.Location).LastWriteTime <= WorkflowManager.LastModified))
return;
foreach (int Version in this.Mappings.Keys)
{
foreach (IWorkflowModule Module in Modules.Where(x => x.Versions.Contains(Version)))
{
foreach (IAPIMapping Mapping in this.Mappings[Version])
{
foreach (WorkflowType ActionType in Enum.GetValues(typeof(WorkflowType))
.OfType<WorkflowType>()
.Where(x => !x.HasFlag(WorkflowType.PreService)
&& !x.HasFlag(WorkflowType.PostService)
&& Module.ActionsTypes.HasFlag(x)))
{
Module.Setup(Mapping.Name, WorkflowManager.CreateWorkflow<WorkflowInfo>(Mapping.Name + "_" + ActionType.ToString() + "_" + Version));
}
}
}
}
foreach (int Version in this.Services.Keys)
{
foreach (IWorkflowModule Module in Modules.Where(x => x.Versions.Contains(Version)))
{
foreach (IService Service in this.Services[Version])
{
foreach (WorkflowType ActionType in new WorkflowType[] { WorkflowType.PreService, WorkflowType.PostService }
.Where(x => Module.ActionsTypes.HasFlag(x)))
{
Module.Setup(Service.Name, WorkflowManager.CreateWorkflow<WorkflowInfo>(Service.Name + "_" + ActionType.ToString() + "_" + Version));
}
}
}
}
}