• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IContextualResourceModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IContextualResourceModel的典型用法代码示例。如果您正苦于以下问题:C# IContextualResourceModel类的具体用法?C# IContextualResourceModel怎么用?C# IContextualResourceModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IContextualResourceModel类属于命名空间,在下文中一共展示了IContextualResourceModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SaveUnsavedWorkflowMessage

 public SaveUnsavedWorkflowMessage(IContextualResourceModel resourceModel, string resourceName, string resourceCategory, bool keepTabOpen)
 {
     ResourceModel = resourceModel;
     ResourceName = resourceName;
     ResourceCategory = resourceCategory;
     KeepTabOpen = keepTabOpen;
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:7,代码来源:SaveUnsavedWorkflowMessage.cs


示例2: CreateDsfActivity

        public static DsfActivity CreateDsfActivity(IContextualResourceModel resource, DsfActivity activity,
                    bool ifNullCreateNew, IEnvironmentRepository environmentRepository, bool isDesignerLocalhost)
        {
            var activityToUpdate = activity;
            if(activityToUpdate == null)
            {
                if(ifNullCreateNew)
                {
                    activityToUpdate = new DsfActivity();
                }
                else
                {
                    return null;
                }
            }

            if(resource != null)
            {
                var activeEnvironment = environmentRepository.ActiveEnvironment;
                activityToUpdate.ResourceID = resource.ID;
                SetCorrectEnvironmentId(resource, activityToUpdate, isDesignerLocalhost, activeEnvironment);
                activityToUpdate = SetActivityProperties(resource, activityToUpdate);
            }

            activityToUpdate.ExplicitDataList = null;
            return activityToUpdate;
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:27,代码来源:DsfActivityFactory.cs


示例3: ShowResourceChanged

 public void ShowResourceChanged(IContextualResourceModel resource, IList<string> numberOfDependants, IResourceChangedDialog resourceChangedDialog = null)
 {
     if(resource == null)
     {
         throw new ArgumentNullException("resource");
     }
     if(numberOfDependants == null)
     {
         throw new ArgumentNullException("numberOfDependants");
     }
     if(resourceChangedDialog == null)
     {
         resourceChangedDialog = new ResourceChangedDialog(resource, numberOfDependants.Count);
     }
     resourceChangedDialog.ShowDialog();
     if(resourceChangedDialog.OpenDependencyGraph)
     {
         if(numberOfDependants.Count == 1)
         {
             var resourceModel = resource.Environment.ResourceRepository.FindSingle(model => model.ResourceName == numberOfDependants[0]);
             if(resourceModel != null)
             {
                 WorkflowDesignerUtils.EditResource(resourceModel, _eventPublisher);
             }
         }
         else
         {
             Dev2Logger.Log.Info("Publish message of type - " + typeof(ShowReverseDependencyVisualizer));
             _eventPublisher.Publish(new ShowReverseDependencyVisualizer(resource));
         }
     }
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:32,代码来源:ResourceChangeHandler.cs


示例4: SetActivityProperties

        public static void SetActivityProperties(IContextualResourceModel resource, ref DsfActivity activity)
        {
            if(resource.WorkflowXaml != null && resource.WorkflowXaml.Length > 0)
            {
                var startIdx = resource.WorkflowXaml.IndexOf("<HelpLink>", 0, true);

                if(startIdx >= 0)
                {
                    var endIdx = resource.WorkflowXaml.IndexOf("</HelpLink>", startIdx, true);

                    if(endIdx > 0)
                    {
                        startIdx += 10;
                        var len = (endIdx - startIdx);

                        activity.HelpLink = resource.WorkflowXaml.Substring(startIdx, len);
                    }
                }

            }

            if(resource.Environment != null) activity.FriendlySourceName = resource.Environment.Name;
            activity.IsWorkflow = true;
            activity.Type = "Workflow";
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:25,代码来源:WorkflowPropertyInterigator.cs


示例5: SetAttachedProperties

 public static void SetAttachedProperties(WorkflowDesignerWindow workflowDesignerWindow,
                                           IContextualResourceModel resource, string iconPath)
 {
     UIElementTitleProperty.SetTitle(workflowDesignerWindow, resource.ResourceName);
     UIElementTabActionContext.SetTabActionContext(workflowDesignerWindow, WorkSurfaceContext.Workflow);
     UIElementImageProperty.SetImage(workflowDesignerWindow, iconPath);
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:7,代码来源:AttachedPropertyHelper.cs


示例6: GetWorkflowUri

        public static Uri GetWorkflowUri(IContextualResourceModel resourceModel, string xmlData, UrlType urlType)
        {
            if(resourceModel == null || resourceModel.Environment == null || resourceModel.Environment.Connection == null || !resourceModel.Environment.IsConnected)
            {
                return null;
            }
            var environmentConnection = resourceModel.Environment.Connection;

            string urlExtension = "xml";
            switch(urlType)
            {
                case UrlType.XML:
                    break;
                case UrlType.JSON:
                    urlExtension = "json";
                    break;
                default:
                    throw new ArgumentOutOfRangeException("urlType");
            }

            var relativeUrl = string.Format("/secure/{0}.{1}?", resourceModel.Category, urlExtension);
            relativeUrl += xmlData;
            relativeUrl += "&wid=" + environmentConnection.WorkspaceID;
            Uri url;
            Uri.TryCreate(environmentConnection.WebServerUri, relativeUrl, out url);
            return url;
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:27,代码来源:WebServer.cs


示例7: RenameResourceDialog

 public RenameResourceDialog(IContextualResourceModel model, string newName, Window owner)
 {
     InitializeComponent();
     Owner = owner ?? Application.Current.MainWindow;
     Title = string.Format(StringResources.DialogTitle_HasDuplicateName, newName);
     tbDisplay.Text = string.Format(StringResources.DialogBody_HasDuplicateName,
                         model.ResourceType.GetDescription(), model.ResourceName);
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:8,代码来源:RenameResourceDialog.xaml.cs


示例8: DeleteResourceDialog

 public DeleteResourceDialog(IContextualResourceModel model)
 {
     InitializeComponent();
     Owner = Application.Current.MainWindow;
     Title = String.Format(StringResources.DialogTitle_HasDependencies, model.ResourceType.GetDescription());
     tbDisplay.Text = String.Format(StringResources.DialogBody_HasDependencies, model.ResourceName,
                                             model.ResourceType.GetDescription());
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:8,代码来源:DeleteResourceDialog.xaml.cs


示例9: OpenInBrowser

 public static void OpenInBrowser(WebServerMethod post, IContextualResourceModel resourceModel, string xmlData)
 {
     Uri url = GetWorkflowUri(resourceModel, xmlData, UrlType.XML);
     if(url != null)
     {
         Process.Start(url.ToString());
     }
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:8,代码来源:WebServer.cs


示例10: OpenInBrowser

 public static void OpenInBrowser(IContextualResourceModel resourceModel, string xmlData)
 {
     Uri url = GetWorkflowUri(resourceModel, xmlData, UrlType.XML);
     if(url != null)
     {
         Process.Start("explorer.exe", "\"" + url+ "\"");
     }
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:8,代码来源:WebServer.cs


示例11: CreateWebActivity

 public static IWebActivity CreateWebActivity(object webActivityWrappingObject, IContextualResourceModel resourceModel, string serviceName)
 {
     IWebActivity activity = CreateWebActivity();
     activity.WebActivityObject = webActivityWrappingObject;
     activity.ResourceModel = resourceModel;
     activity.ServiceName = serviceName;
     return activity;
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:8,代码来源:WebActivityFactory.cs


示例12: WorkflowDesignerViewModelMock

 public WorkflowDesignerViewModelMock(IContextualResourceModel resource, IWorkflowHelper workflowHelper, IPopupController popupController, bool createDesigner = false)
     : base(new Mock<IEventAggregator>().Object,
         resource, workflowHelper,
         popupController, new TestAsyncWorker(), createDesigner, false, false)
 {
     _moq.SetupAllProperties();
     _wd = _moq.Object;
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:8,代码来源:WorkflowDesignerViewModelMock.cs


示例13: GetDependenciesXml

        /// <summary>
        /// Gets the dependencies XML for the given <see cref="IResourceModel"/>.
        /// </summary>
        /// <param name="resourceModel">The resource model to be queried.</param>
        /// <returns>The dependencies XML.</returns>
        public string GetDependenciesXml(IContextualResourceModel resourceModel)
        {
            if(resourceModel == null)
            {
                return string.Empty;
            }

            return resourceModel.Environment.ResourceRepository.GetDependenciesXml(resourceModel);
            }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:14,代码来源:ResourceDependencyService.cs


示例14: CreateServiceDebugInfoModel

 public static IServiceDebugInfoModel CreateServiceDebugInfoModel(IContextualResourceModel resourceModel, string serviceInputData, DebugMode debugSetting)
 {
     IServiceDebugInfoModel serviceDebugInfoModel = new ServiceDebugInfoModel();
     serviceDebugInfoModel.ResourceModel = resourceModel;
     serviceDebugInfoModel.DebugModeSetting = debugSetting;
     serviceDebugInfoModel.ServiceInputData = serviceInputData;
     serviceDebugInfoModel.RememberInputs = true;
     return serviceDebugInfoModel;
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:9,代码来源:ServiceDebugInfoModelFactory.cs


示例15: SetActivityProperties

        public static void SetActivityProperties(IContextualResourceModel resource, ref DsfActivity activity, IResourceRepository resourceRepository)
        {
            activity.IsWorkflow = false;

            if(resource.WorkflowXaml != null && resource.WorkflowXaml.Length > 0)
            {

                var startIdx = resource.WorkflowXaml.IndexOf("<Action ", 0, true);

                if(startIdx >= 0)
                {
                    var endIdx = resource.WorkflowXaml.IndexOf(">", startIdx, true);
                    if(endIdx > 0)
                    {
                        var len = endIdx - startIdx + 1;
                        var fragment = resource.WorkflowXaml.Substring(startIdx, len);

                        fragment += "</Action>";
                        fragment = fragment.Replace("&", "&amp;");
                        XmlDocument document = new XmlDocument();

                        document.LoadXml(fragment);

                        if(document.DocumentElement != null)
                        {
                            XmlNode node = document.SelectSingleNode("//Action");
                            if(node != null)
                            {
                                if(node.Attributes != null)
                                {
                                    var attr = node.Attributes["SourceName"];
                                    if(attr != null)
                                    {
                                        if (resourceRepository != null && node.Attributes["SourceID"] != null)
                                        {
                                            Guid sourceId;
                                            Guid.TryParse( node.Attributes["SourceID"].Value, out sourceId);
                                            activity.FriendlySourceName = resourceRepository.FindSingle(a => !(a.ID.ToString() != sourceId.ToString()),false).DisplayName;
                                        }
                                        else
                                        activity.FriendlySourceName = attr.Value;
                                    }

                                    attr = node.Attributes["SourceMethod"];
                                    if(attr != null)
                                    {
                                        activity.ActionName = attr.Value;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            activity.Type = resource.ServerResourceType;
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:56,代码来源:WorkerServicePropertyInterigator.cs


示例16: CheckIfRemoteWorkflowAndSetProperties

        public static void CheckIfRemoteWorkflowAndSetProperties(DsfActivity dsfActivity, IContextualResourceModel resource, IEnvironmentModel contextEnv)
        {
            if(resource != null && resource.ResourceType == ResourceType.WorkflowService && contextEnv != null)
            {
                if(contextEnv.ID != resource.Environment.ID)
                {
                    dsfActivity.ServiceUri = resource.Environment.Connection.WebServerUri.AbsoluteUri;
                    dsfActivity.ServiceServer = resource.Environment.ID;

                }
                dsfActivity.FriendlySourceName = new InArgument<string>(resource.Environment.Connection.WebServerUri.Host);
            }
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:13,代码来源:WorkflowDesignerUtils.cs


示例17: GetCompileMessagesFromServer

        public CompileMessageList GetCompileMessagesFromServer(IContextualResourceModel resourceModel)
        {
            var comsController = new CommunicationController { ServiceName = "FetchDependantCompileMessagesService" };

            var workspaceID = GlobalConstants.ServerWorkspaceID;

            comsController.AddPayloadArgument("ServiceID", resourceModel.ID.ToString());
            comsController.AddPayloadArgument("WorkspaceID", workspaceID.ToString());
            var con = resourceModel.Environment.Connection;
            var result = comsController.ExecuteCommand<CompileMessageList>(con, GlobalConstants.ServerWorkspaceID);

            return result;
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:13,代码来源:StudioCompileMessageRepo.cs


示例18: SetActivityProperties

 static DsfActivity SetActivityProperties(IContextualResourceModel resource, DsfActivity activity)
 {
     
     switch(resource.ResourceType)
     {
         case ResourceType.WorkflowService:
             WorkflowPropertyInterigator.SetActivityProperties(resource, ref activity);
             break;
         case ResourceType.Service:
             WorkerServicePropertyInterigator.SetActivityProperties(resource, ref activity,resource.Environment.ResourceRepository);
             break;
     }
     return activity;
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:14,代码来源:DsfActivityFactory.cs


示例19: SetCorrectEnvironmentId

        static void SetCorrectEnvironmentId(IContextualResourceModel resource, DsfActivity activity, bool isDesignerLocalhost, IEnvironmentModel activeEnvironment)
        {
            if(resource.Environment != null)
            {
                var idToUse = resource.Environment.ID;

                //// when we have an active remote environment that we are designing against, set it as local to that environment ;)
                if(activeEnvironment.ID == resource.Environment.ID && idToUse != Guid.Empty && !isDesignerLocalhost)
                {
                    idToUse = Guid.Empty;
                }

                activity.EnvironmentID = idToUse;
            }
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:15,代码来源:DsfActivityFactory.cs


示例20: Create

        public static IDebugState Create(string message, IContextualResourceModel resourceModel)
        {
            var state = new DebugState
                {
                    Message = message,
                };

            if(resourceModel != null)
            {
                state.ServerID = resourceModel.ServerID;
                state.OriginatingResourceID = resourceModel.ID;
            }
            state.StateType = String.IsNullOrWhiteSpace(message) ? StateType.Clear : StateType.Message;

            return state;
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:16,代码来源:DebugStateFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IContinuation类代码示例发布时间:2022-05-24
下一篇:
C# IContextRegistry类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap