Dev2.Webs.RootWebSite.ShowDialog C# (CSharp) Method

ShowDialog() public static method

public static ShowDialog ( IContextualResourceModel resourceModel ) : bool
resourceModel IContextualResourceModel
return bool
        public static bool ShowDialog(IContextualResourceModel resourceModel)
        {
            if(resourceModel == null)
            {
                return false;
            }

            string resourceId = resourceModel.ID.ToString();

            ResourceType resourceType;
            Enum.TryParse(resourceModel.ServerResourceType, out resourceType);

            if(resourceType == ResourceType.WorkflowService && resourceModel.ID == Guid.Empty)
            {
                ShowNewWorkflowSaveDialog(resourceModel);
            }
            else
            {
                // we need to take the SourceID out and pass along ;)
                var srcId = Guid.Empty.ToString();
                if(resourceModel.WorkflowXaml != null)
                {
                    var workflowXaml = resourceModel.WorkflowXaml;

                    try
                    {
                        var xe = workflowXaml.Replace("&", "&").ToXElement();
                        srcId = xe.AttributeSafe("SourceID");
                    }
                    catch
                    {
                        srcId = workflowXaml.ExtractXmlAttributeFromUnsafeXml("SourceID=\"");
                    }
                }

                return ShowDialog(resourceModel.Environment, resourceType, null, resourceModel.Category, resourceId, srcId, resourceModel.ResourceName);
            }
            return true;
        }

Same methods

RootWebSite::ShowDialog ( IEnvironmentModel environment, ResourceType resourceType, string resourcePath, string cateogy, string resourceId = null, string srcId = null, string resourceName = null ) : bool

Usage Example

示例#1
0
 public void DisplayDialogue(IContextualResourceModel resourceModel, bool includeArgs)
 {
     if (RootWebSite.ShowDialog(resourceModel))
     {
     }
 }