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


C# UrlString.Append方法代码示例

本文整理汇总了C#中UrlString.Append方法的典型用法代码示例。如果您正苦于以下问题:C# UrlString.Append方法的具体用法?C# UrlString.Append怎么用?C# UrlString.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UrlString的用法示例。


在下文中一共展示了UrlString.Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        public override void Execute(CommandContext context)
        {
            string scriptId = context.Parameters["script"];
            string scriptDb = context.Parameters["scriptDb"];
            Item scriptItem = Factory.GetDatabase(scriptDb).GetItem(new ID(scriptId));

            string showResults = scriptItem[ScriptItemFieldNames.ShowResults];
            string itemId = string.Empty;
            string itemDb = string.Empty;

            if (context.Items.Length > 0)
            {
                itemId = context.Items[0].ID.ToString();
                itemDb = context.Items[0].Database.Name;
            }

            var str = new UrlString(UIUtil.GetUri("control:PowerShellRunner"));
            str.Append("id", itemId);
            str.Append("db", itemDb);
            str.Append("scriptId", scriptId);
            str.Append("scriptDb", scriptDb);
            str.Append("autoClose", showResults);
            Context.ClientPage.ClientResponse.Broadcast(
                SheerResponse.ShowModalDialog(str.ToString(), "400", "220", "PowerShell Script Results", false),
                "Shell");
        }
开发者ID:scjunkie,项目名称:Console,代码行数:26,代码来源:ExecutePowerShellScript.cs

示例2: Run

        protected virtual void Run(ClientPipelineArgs args)
        {
            string databaseName = args.Parameters["databasename"];
             string id = args.Parameters["id"];

             Database database = Factory.GetDatabase(databaseName);
             Assert.IsNotNull(database, typeof (Database), "Database \"" + database + "\" not found.", new object[0]);
             Item item = database.Items[id];

             if (item != null)
             {
                     if (item.Fields[FieldIDs.LayoutField] != null && item.Fields[FieldIDs.LayoutField].Value != string.Empty)
            {
                  if (!args.IsPostBack)
                  {
                     UrlString url = new UrlString(UIUtil.GetUri("control:Calendar.ConfigureControls"));
                     url.Append("id", item.ID.ToString());
                     url.Append("db", item.Database.Name);

                     Windows.RunApplication("Calendar ConfigureControls", url.GetUrl());
                  }
            }
            else
            {
               Context.ClientPage.ClientResponse.Alert(ResourceManager.Localize("ITEM_HAS_NO_LAYOUT"));
            }
             }
             else
             {
            SheerResponse.Alert("Item not found.", new string[0]);
             }
        }
开发者ID:Refactored,项目名称:SitecoreCalendarModule,代码行数:32,代码来源:Open.cs

示例3: Run

        protected void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            string dbName = args.Parameters["databasename"];
            string id = args.Parameters["id"];
            string lang = args.Parameters["language"];
            string ver = args.Parameters["version"];
            Database database = Factory.GetDatabase(dbName);

            Assert.IsNotNull(database, dbName);

            Item obj = database.Items[id, Language.Parse(lang), Version.Parse(ver)];
            if (obj == null)
            {
                SheerResponse.Alert("Item not found.");
            }
            else
            {
                if (!SheerResponse.CheckModified())
                    return;
                if (args.IsPostBack)
                {
                    return;
                }

                UrlString urlString = new UrlString(UIUtil.GetUri("control:SchedulePublish"));
                urlString.Append("id", obj.ID.ToString());
                urlString.Append("unpublish", args.Parameters["unpublish"]);
                SheerResponse.ShowModalDialog(urlString.ToString(), "600", "600", string.Empty, true);
                args.WaitForPostBack();
            }
        }
开发者ID:maxslabyak,项目名称:SCScheduledPublishing,代码行数:33,代码来源:OpenScheduledPublishDialog.cs

示例4: OpenNewWindow

 private void OpenNewWindow(ID id, string name)
 {
     Assert.ArgumentNotNull(id, "id");
     UrlString url = new UrlString(Constants.Url.ExportFromDataPage);
     url.Append(Constants.QueryString.Name.ItemId, HttpContext.Current.Server.UrlEncode(id.ToString()));
     url.Append(Constants.QueryString.Name.ItemName, HttpContext.Current.Server.UrlEncode(name));
     SheerResponse.Eval(string.Format("window.open('{0}');", url));
 }
开发者ID:ptiemann,项目名称:WFFM-SQL-Server-SaveToDatabase,代码行数:8,代码来源:ExportFormDataCommand.cs

示例5: Execute

		/// <summary>
		/// Executes the command in the specified context.
		/// 
		/// </summary>
		/// <param name="context">The context.</param>
		public override void Execute(CommandContext context)
		{
			Error.AssertObject((object)context, "context");
			if (context.Items.Length != 1 || context.Items[0] == null)
				return;
			Item obj = context.Items[0];
			UrlString urlString = new UrlString(UIUtil.GetUri("control:CsvUserImport"));
			urlString.Append("id", obj.ID.ToString());
			urlString.Append("database", obj.Database.ToString());
			Context.ClientPage.ClientResponse.ShowModalDialog(urlString.ToString());
		}
开发者ID:csulham,项目名称:Sitecore.SharedSource.UserCsvImport,代码行数:16,代码来源:LoadCsvButtonAction.cs

示例6: Execute

        public override void Execute(CommandContext context)
        {
            string itemId = context.Items[0].ID.ToString();
            string itemDb = context.Items[0].Database.Name;
            Item item = Factory.GetDatabase(itemDb).GetItem(new ID(itemId));

            var urlString = new UrlString();
            urlString.Append("item", item.Paths.Path.ToLower().Replace("sitecore/", ""));
            urlString.Append("db", itemDb);
            Windows.RunApplication("PowerShell/PowerShell Console", urlString.ToString());
        }
开发者ID:scjunkie,项目名称:Console,代码行数:11,代码来源:ExecutePowerShellConsole.cs

示例7: Execute

 public override void Execute(CommandContext context)
 {
     Error.AssertObject(context, "context");
     if ((context.Items.Length == 1) && (context.Items[0] != null))
     {
         Item item = context.Items[0];
        UrlString str = new UrlString("/sitecore modules/Shell/Cloning Manager/Controls/CloningInfo.aspx");
         str.Append("id", item.ID.ToString());
         str.Append("la", item.Language.ToString());
         str.Append("vs", item.Version.ToString());
         Sitecore.Context.ClientPage.ClientResponse.ShowModalDialog(str.ToString());
     }
 }
开发者ID:nleSitecore,项目名称:CloningManager,代码行数:13,代码来源:ManagerViewer.cs

示例8: Run

 protected void Run(ClientPipelineArgs args)
 {
     Assert.ArgumentNotNull(args, "args");
     if (!args.IsPostBack)
     {
         var str2 = new UrlString(UIUtil.GetUri("control:DataSyncWizard"));
         str2.Append("id", args.Parameters["id"]);
         str2.Append("la", args.Parameters["language"]);
         str2.Append("vs", args.Parameters["version"]);
         SheerResponse.ShowModalDialog(str2.ToString(), "550", "500");
         args.WaitForPostBack();
     }
 }
开发者ID:NetlabSharedSource,项目名称:SitecoreDataSync,代码行数:13,代码来源:DataSyncWizardCommand.cs

示例9: Execute

        public override void Execute(CommandContext context)
        {
            var itemId = context.Items[0].ID.ToString();
            var itemDb = context.Items[0].Database.Name;
            var item = Factory.GetDatabase(itemDb).GetItem(new ID(itemId));

            var urlString = new UrlString();
            urlString.Append("id", item.ID.ToString());
            urlString.Append("db", itemDb);
            if (!string.IsNullOrEmpty(context.Parameters["frameName"]))
            {
                urlString.Add("pfn", context.Parameters["frameName"]);
            }
            Windows.RunApplication("PowerShell/PowerShellIse", urlString.ToString());
        }
开发者ID:GuitarRich,项目名称:Console,代码行数:15,代码来源:EditPowerShellScript.cs

示例10: DoRender

    protected override void DoRender(HtmlTextWriter output) {
      var src = new UrlString("/sitecore/shell/~/xaml/Outercore.FieldTypes.Carousel.Frame.aspx");
      src.Append("s", Source);
      src.Append("id", ItemID);
      src.Append("fid", ID);
      src.Append("v", Value);
      if (Disabled) {
        src.Append("d", "1");
      }

      output.Write("<div id='{0}_pane' class='scContentControl scImageList'>".FormatWith(ID));
      output.Write("<iframe id='{0}_frame' src='{1}' frameborder='0' marginwidth='0' marginheight='0' width='100%' height='128' allowtransparency='allowtransparency'></iframe>".FormatWith(ID, src.ToString()));
      output.Write("</div>");

      output.Write("<input type='hidden' id='{0}' value='{1}' />".FormatWith(ID + "_selected", Value));
    }
开发者ID:adeneys,项目名称:Outercore.FieldTypes,代码行数:16,代码来源:CarouselContentField.cs

示例11: PostStep

        protected void PostStep(Item item)
        {
            Assert.ArgumentNotNull(item, "item");

             if (callback != null)
             {
            callback(item.ID.ToString());
             }

             UrlString url = new UrlString();
             url.Append("ro", item.ID.ToString());
             url.Append("fo", item.ID.ToString());
             url.Append("id", item.ID.ToString());
             url.Append("la", item.Language.Name);
             url.Append("vs", item.Version.Number.ToString());
             Windows.RunApplication("Content editor", url.GetUrl());
        }
开发者ID:Refactored,项目名称:SitecoreCalendarModule,代码行数:17,代码来源:CreateItem.cs

示例12: Run

        protected void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            string[] uris = StringUtil.Split(args.Parameters["uris"], '|', false);
            if (args.IsPostBack)
            {
                if (args.HasResult)
                {
                    string result = args.Result;
                    if (result == "-")
                    {
                        result = string.Empty;
                    }

                    foreach (var uri in uris)
                    {
                        if (ItemUri.IsItemUri(uri))
                        {
                            Item item = Database.GetItem(ItemUri.Parse(uri));
                            item.Editing.BeginEdit();
                            item[FieldIDs.Owner] = result;
                            item.Editing.EndEdit();
                            Log.Audit(this, "Set owner: {0}", new string[] { AuditFormatter.FormatItem(item) });
                        }
                    }
                }
            }
            else
            {
                if (ItemUri.IsItemUri(uris[0]))
                {
                    ItemUri uri = ItemUri.Parse(uris[0]);
                    UrlString str6 = new UrlString("/sitecore/shell/~/xaml/Sitecore.Shell.Applications.Security.SetOwner.aspx");

                    str6.Append("id", uri.Path);
                    str6.Append("la", uri.Language.ToString());
                    str6.Append("vs", uri.Version.ToString());
                    str6.Append("db", uri.DatabaseName);
                    SheerResponse.ShowModalDialog(str6.ToString(), "450", "180", string.Empty, true);
                    args.WaitForPostBack();
                }
            }
        }
开发者ID:earlnuclear,项目名称:AdvancedSystemReporter,代码行数:44,代码来源:SetOwner.cs

示例13: BrowseIconDialog

 protected void BrowseIconDialog(ClientPipelineArgs args)
 {
     if (args.IsPostBack)
     {
         if (args.HasResult)
         {
             Value = args.Result;
             SetModified();
         }
     }
     else
     {
         UrlString urlString = new UrlString("/sitecore/shell/Applications/Dialogs/FontIconPickerField/Browse.aspx");
         urlString.Append("source", GetViewStateString("source"));
         urlString.Append("value", Value);
         SheerResponse.ShowModalDialog(urlString.ToString(), "1120", "600", string.Empty, true);
         args.WaitForPostBack();
     }
 }
开发者ID:dthunziker,项目名称:sitecore-font-icon-picker-field,代码行数:19,代码来源:FontIconPickerField.cs

示例14: Execute

 public override void Execute(CommandContext context)
 {
     Assert.ArgumentNotNull(context, "context");
     if (context.Items.Length == 1)
     {
         UrlString parameters = new UrlString();
         parameters.Append("fo", context.Items[0].ID.ToString());
         Shell.Framework.Windows.RunApplication("Media Conversion Tool", parameters.ToString());
     }
 }
开发者ID:ivansharamok,项目名称:MediaConversionTool,代码行数:10,代码来源:OpenMediaConversionTool.cs

示例15: Execute

        public override void Execute(CommandContext context)
        {
            if (context.Items.Length == 1)
            {
                Item item = context.Items[0];
                UrlString str = new UrlString();
                str.Append("sc_content", item.Database.Name);
                str.Append("id", item.ID.ToString());
                str.Append("la", item.Language.ToString());
                str.Append("vs", item.Version.ToString());
                if (!string.IsNullOrEmpty(context.Parameters["frameName"]))
                {
                    str.Add("pfn", context.Parameters["frameName"]);
                }


                SheerResponse.Eval("window.open('/sitecore modules/pixlr/pixlr.aspx?" + str + "&mode=editor', 'MediaLibrary', 'location=0,resizable=1')");

            }
        }
开发者ID:johnpen,项目名称:SharedSource.Pixlr,代码行数:20,代码来源:Advanced.cs


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