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


C# IContextualResourceModel类代码示例

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


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


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