当前位置: 首页>>代码示例>>C#>>正文


C# Utilities.CreateWorkflow方法代码示例

本文整理汇总了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));
                        }
                    }
                }
            }
        }
开发者ID:JaCraig,项目名称:Craig-s-Utility-Library,代码行数:75,代码来源:Manager.cs


注:本文中的Utilities.CreateWorkflow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。