public void Execute(
            XElement element,
            string name,
            UrlString parameters, string value)
        {
            SC.Diagnostics.Assert.ArgumentNotNull(element, "element");
            SC.Diagnostics.Assert.ArgumentNotNull(name, "name");
            SC.Diagnostics.Assert.ArgumentNotNull(parameters, "parameters");
            SC.Diagnostics.Assert.ArgumentNotNull(value, "value");
            SC.Shell.Applications.Dialogs.ItemLister.SelectItemOptions options =
                new SC.Shell.Applications.Dialogs.ItemLister.SelectItemOptions();

            if (!String.IsNullOrEmpty(value))
            {
                SC.Data.Items.Item item = SC.Client.ContentDatabase.GetItem(
                    value);

                if (item != null)
                {
                    options.SelectedItem = item;
                }
            }

            options.Root = SC.Client.ContentDatabase.GetItem(
                "/sitecore/system/Settings/Rules/Validation Rules/ValidatorResults");
            options.Title    = "Select Validator Result";
            options.Text     = "Select the validation result to use in this rule.";
            options.Icon     = "Applications/16x16/preferences.png";
            options.ShowRoot = false;
            SC.Web.UI.Sheer.SheerResponse.ShowModalDialog(
                options.ToUrlString().ToString(),
                true);
        }
コード例 #2
0
        public void Execute(
            XElement element,
            string name,
            SC.Text.UrlString parameters,
            string value)
        {
            SC.Diagnostics.Assert.ArgumentNotNull(element, "element");
            SC.Diagnostics.Assert.ArgumentNotNull(name, "name");
            SC.Diagnostics.Assert.ArgumentNotNull(parameters, "parameters");
            SC.Diagnostics.Assert.ArgumentNotNull(value, "value");
            SC.Diagnostics.Assert.IsNotNull(
                SC.Context.ContentDatabase,
                "Sitecore.Context.ContentDatabase");
            SC.Shell.Applications.Dialogs.ItemLister.SelectItemOptions options =
                new SC.Shell.Applications.Dialogs.ItemLister.SelectItemOptions();

            if (!String.IsNullOrEmpty(value))
            {
                SC.Data.Items.Item item = Client.ContentDatabase.GetItem(value);

                if (item != null)
                {
                    options.SelectedItem = item;
                }
            }

            options.Root = Client.ContentDatabase.GetItem(SC.ItemIDs.WorkflowRoot);
            SC.Data.Items.TemplateItem workflowCommandTemplate = SC.Context.ContentDatabase.GetTemplate(
                SC.TemplateIDs.WorkflowCommand);
            SC.Diagnostics.Assert.IsNotNull(workflowCommandTemplate, "workflowCommandTemplate");
            options.IncludeTemplatesForSelection = SC.Shell.Applications.Dialogs.ItemLister.SelectItemOptions.GetTemplateList(
                workflowCommandTemplate.GetSelfAndDerivedTemplates());
            options.Title = "Select Workflow Command";
            options.Text  = "Select the workflow command to use in this rule.";
            options.Icon  = "Applications/16x16/nav_right_green.png";
            SC.Web.UI.Sheer.SheerResponse.ShowModalDialog(
                options.ToUrlString().ToString(),
                true);
        }