本文整理汇总了C#中ClientPipelineArgs类的典型用法代码示例。如果您正苦于以下问题:C# ClientPipelineArgs类的具体用法?C# ClientPipelineArgs怎么用?C# ClientPipelineArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientPipelineArgs类属于命名空间,在下文中一共展示了ClientPipelineArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Process
protected void Process(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (args.IsPostBack) return;
SheerResponse.ShowModalDialog(new UrlString(UIUtil.GetUri("control:ConfigurationWizard")).ToString(), true);
args.WaitForPostBack();
}
开发者ID:sitecore-myu,项目名称:Sitecore-Feedback-Module,代码行数:7,代码来源:ConfigurationCommand.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: Start
public void Start(ClientPipelineArgs args)
{
if (args.IsPostBack)
{
Database database =
Sitecore.Configuration.Factory.GetDatabase(
Settings.Instance.ConfigurationDatabase);
Assert.IsNotNull(database, "configuration database is null");
Item report = database.GetItem(Current.Context.ReportItem.ID);
Assert.IsNotNull(report, "can't find report item");
Sitecore.Context.ClientPage.SendMessage(this, "ASR.MainForm:updateparameters");
using (new Sitecore.SecurityModel.SecurityDisabler())
{
Item newItem = ItemUtil.AddFromTemplate(args.Result, "System/ASR/Saved Report", report);
using (new EditContext(newItem))
{
newItem["parameters"] = Current.Context.ReportItem.SerializeParameters("^", "&");
newItem[Sitecore.FieldIDs.Owner] = Sitecore.Context.User.Name;
}
}
}
else
{
Sitecore.Context.ClientPage.ClientResponse.Input("Enter the name of the new blog entry:",
"report name", Sitecore.Configuration.Settings.ItemNameValidation, "'$Input' is not a valid name.",
Sitecore.Configuration.Settings.MaxItemNameLength);
args.WaitForPostBack(true);
}
}
开发者ID:earlnuclear,项目名称:AdvancedSystemReporter,代码行数:33,代码来源:Save.cs
示例4: Run
protected void Run(ClientPipelineArgs args)
{
Item itemNotNull = Sitecore.Client.GetItemNotNull(args.Parameters["itemid"], Language.Parse(args.Parameters["language"]), new Sitecore.Data.Version(args.Parameters["version"]), Database.GetDatabase(args.Parameters["database"]));
UrlString urlString = ResourceUri.Parse("Control:EditPageProperties").ToUrlString();
itemNotNull.Uri.AddToUrlString(urlString);
SheerResponse.ShowModalDialog(urlString.ToString(), false);
}
开发者ID:1508,项目名称:SitecoreExtension-PageProperties,代码行数:7,代码来源:Show.cs
示例5: Run
protected virtual void Run(ClientPipelineArgs args)
{
//if (Sitecore.Context.IsAdministrator || allowNonAdminDownload())
//{
// string tempPath = GetFilePath();
// SheerResponse.Download(tempPath);
//}
//else
//{
if (!args.IsPostBack)
{
string email = Sitecore.Context.User.Profile.Email;
SheerResponse.Input("Enter your email address", email);
args.WaitForPostBack();
}
else
{
if (args.HasResult)
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(args.Result);
string tempPath = GetFilePath();
message.Attachments.Add(new System.Net.Mail.Attachment(tempPath));
message.Subject = string.Format("ASR Report ({0})", Current.Context.ReportItem.Name);
message.From = new System.Net.Mail.MailAddress(Current.Context.Settings.EmailFrom);
message.Body = "Attached is your report sent at " + DateTime.Now.ToString("dd/MM/yyyy HH:mm");
Sitecore.MainUtil.SendMail(message);
}
}
//}
}
开发者ID:svn2github,项目名称:AdvancedSystemReporter,代码行数:31,代码来源:ExportBaseCommand.cs
示例6: RunCommand
public void RunCommand(ClientPipelineArgs args)
{
//get parameters from the ui
Sitecore.Context.ClientPage.SendMessage(this, "ASR.MainForm:updateparameters");
Current.Context.Report =
Current.Context.ReportItem.TransformToReport(Current.Context.Report);
//if (Current.Context.Report == null)
//{
// Current.Context.Report = new Report();
//}
//foreach (var sItem in Current.Context.ReportItem.Scanners)
//{
// Current.Context.Report.AddScanner(sItem);
//}
//foreach (var vItem in Current.Context.ReportItem.Viewers)
//{
// Current.Context.Report.AddViewer(vItem);
//}
//foreach (var fItem in Current.Context.ReportItem.Filters)
//{
// Current.Context.Report.AddFilter(fItem);
//}
Sitecore.Shell.Applications.Dialogs.ProgressBoxes.ProgressBox.Execute(
"Scanning...",
"Scanning items",
"",
Current.Context.Report.Run,
"MainForm:runfinished",
new object[] { });
}
开发者ID:svn2github,项目名称:AdvancedSystemReporter,代码行数:32,代码来源:ReportRunner.cs
示例7: GetDatabase
/// <summary>
/// Copied Sitecore.Shell.Framework.Pipelines.DragItemTo
/// Method is listed as private in Sitecore
/// </summary>
/// <param name = "args"></param>
/// <returns>Item</returns>
private static Database GetDatabase(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
Database database = Factory.GetDatabase(args.Parameters["database"]);
Error.Assert(database != null, "Database \"" + args.Parameters["database"] + "\" not found.");
return database;
}
开发者ID:Velir,项目名称:Sitecore-MoveValidator,代码行数:13,代码来源:CustomDragItemTo.cs
示例8: Execute
public override void Execute(CommandContext context)
{
/*TODO
* Prüfung auf Cloned und Adoption Item
* Prüfen auf Berechtigung Adoption:Change
* JA: Disable field editing! Info Anzeige dass Item Adopted ist und nicht geändert werden darf
*
*/
Assert.ArgumentNotNull(context, "context");
if (context.Items.Length == 1)
{
NameValueCollection parameters = new NameValueCollection();
parameters["items"] = base.SerializeItems(context.Items);
parameters["domainname"] = context.Parameters["domainname"];
parameters["accountname"] = context.Parameters["accountname"];
parameters["accounttype"] = context.Parameters["accounttype"];
parameters["fieldid"] = context.Parameters["fieldid"];
ClientPipelineArgs args = new ClientPipelineArgs(parameters);
if (ContinuationManager.Current != null)
{
ContinuationManager.Current.Start(this, "Run", args);
}
else
{
Context.ClientPage.Start(this, "Run", args);
}
}
}
开发者ID:nleSitecore,项目名称:CloningManager,代码行数:29,代码来源:OpenAdoptionItem.cs
示例9: RunEditForm
/// <summary>
/// This method runs the rotating image modal
/// </summary>
/// <param name="args"></param>
public void RunEditForm(ClientPipelineArgs args)
{
if (!args.IsPostBack)
{
//get url for field type selector modal
UrlString ustr = new UrlString(UIUtil.GetUri("control:FieldSuiteEditForm"));
ustr.Parameters.Add(args.Parameters);
//open field type selector
Sitecore.Context.ClientPage.ClientResponse.ShowModalDialog(ustr.ToString(), "712", "485", "", true);
//wait for response
args.WaitForPostBack();
}
else
{
string itemId = args.Parameters["id"];
if(!string.IsNullOrEmpty(itemId) && Sitecore.Context.ContentDatabase != null)
{
Item item = Sitecore.Context.ContentDatabase.GetItem(itemId);
if(item.IsNotNull())
{
UnlockItem(item);
//send command to update list update's field gutter
if (args.Parameters["fieldid"] != null && !string.IsNullOrEmpty(args.Parameters["fieldid"]))
{
string fieldGutterHtml = GetFieldGutterHtml(new FieldGutterArgs(item, args.Parameters["fieldid"]));
SheerResponse.Eval("FieldSuite.Fields.UpdateItemFieldGutter(\"" + args.Parameters["fieldid"] + "\",\"" + HttpUtility.HtmlEncode(fieldGutterHtml) + "\",\"" + item.ID + "\")");
}
}
}
}
}
开发者ID:erzr,项目名称:SitecoreFieldSuite,代码行数:38,代码来源:EditItem.cs
示例10: 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
示例11: Run
protected void Run(ClientPipelineArgs args)
{
if (!args.IsPostBack)
{
SheerResponse.CheckModified(true);
args.WaitForPostBack();
}
else if ((args.Result != "cancel") && (args.HasResult && (args.Result != "cancel")))
{
if ((args.Result == "yes") || (args.Result == "no"))
{
if (args.Result == "yes")
{
this.SaveChanges();
}
SheerResponse.Input("Enter the number of latest emails to export: ", "50", "^[1-9][0-9]", String.Format("'{0}' is not a valid number.", new object[] { "$Input" }), 100);
args.WaitForPostBack();
}
else if (this.CreateList(args.Result))
{
//SheerResponse.Alert("Finished", new string[0]);
//NotificationManager.Instance.Notify("RefreshRecipientLists", new EventArgs());
}
else
{
//SheerResponse.Alert(EcmTexts.Localize("The '{0}' list already exists, please choose another name.", new object[] { args.Result }), new string[0]);
}
}
}
开发者ID:katebutenko,项目名称:ECMReports,代码行数:29,代码来源:SummaryReportCSVExportCommand.cs
示例12: Run
/// <summary>
/// Run Command
/// </summary>
/// <param name="args">
/// The args.
/// </param>
protected void Run(ClientPipelineArgs args)
{
if (args.IsPostBack)
{
if (args.HasResult)
{
if (args.Result == "yes")
{
var parentId = Context.ContentDatabase.GetItem(args.Parameters["id"]).Parent.ID;
Context.ClientPage.SendMessage(this, "item:bucket(id=" + parentId + ")");
Context.ClientPage.SendMessage(this, "item:refreshchildren(id=" + parentId + ")");
args.Result = string.Empty;
}
else
{
args.Result = string.Empty;
args.IsPostBack = false;
return;
}
}
}
else
{
Context.ClientPage.ClientResponse.Confirm("You have reached the recommended sibling item count and it is recommended to turn the parent item into a bucket. Continue?");
args.WaitForPostBack();
}
}
开发者ID:udt1106,项目名称:Sitecore-Item-Buckets,代码行数:33,代码来源:AutoBucket.cs
示例13: Run
protected virtual void Run(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
var id = args.Parameters["id"];
var language = args.Parameters["language"];
var version = args.Parameters["version"];
var item = Context.ContentDatabase.Items[id, Language.Parse(language), Version.Parse(version)];
if (item == null)
{
SheerResponse.Alert("Item not found");
return;
}
if (Context.IsAdministrator || item.Access.CanWrite() && (item.Locking.CanLock() || item.Locking.HasLock()))
{
if (SheerResponse.CheckModified())
{
Version[] versionNumbers = item.Versions.GetVersionNumbers(false);
Log.Audit(this, "Add version:{0}", AuditFormatter.FormatItem(item));
var newVersion = item.Versions.AddVersion();
if (newVersion != null)
{
Context.ClientPage.SendMessage(this,string.Format("item:versionadded(id={0},version={1},language={2})",newVersion.ID,newVersion.Version,newVersion.Language));
}
}
}
else
{
SheerResponse.Alert("You don't have permissions to do this");
}
}
开发者ID:rauljmz,项目名称:SiteLanguageBlocker,代码行数:32,代码来源:AddVersion.cs
示例14: Run
public void Run(ClientPipelineArgs args)
{
string fieldValue = args.Parameters["fieldValue"];
if (!args.IsPostBack)
{
var url = UIUtil.GetUri("control:ProductBrowser", "product=" + fieldValue);
SheerResponse.ShowModalDialog(url,true);
args.WaitForPostBack();
}
else
{
if (args.HasResult)
{
var result = args.Result;
SheerResponse.SetAttribute("scHtmlValue", "value", result);
SheerResponse.SetAttribute("scPlainValue", "value", result);
var builder = new ScriptInvokationBuilder("scSetHtmlValue");
builder.AddString(args.Parameters["controlid"], new object[0]);
if (string.IsNullOrEmpty(result))
{
builder.Add("true");
}
SheerResponse.Eval(builder.ToString());
}
}
}
开发者ID:rauljmz,项目名称:FieldCommandExample,代码行数:27,代码来源:Open.cs
示例15: HandleResult
protected virtual void HandleResult(ClientPipelineArgs args)
{
var layoutAsXml = WebUtil.GetSessionString(args.Parameters["handleName"]);
var layoutAsJson = Sitecore.Web.WebEditUtil.ConvertXMLLayoutToJSON(layoutAsXml);
SheerResponse.SetAttribute("scLayoutDefinition", "value", layoutAsJson);
SheerResponse.Eval("window.parent.Sitecore.PageModes.ChromeManager.handleMessage('chrome:rendering:propertiescompleted');");
}
开发者ID:JRondeau16,项目名称:sitecore-clientextensions,代码行数:7,代码来源:EditRenderingProperties.cs
示例16: Execute
public override void Execute(CommandContext context)
{
if (!AnalyticsSettings.Enabled)
{
SheerResponse.Alert(Translate.Text("You need to enable Analytics to use this functionality"));
}
else
{
Assert.ArgumentNotNull((object)context, "context");
if (context.Items.Length != 1)
return;
if (!SecurityHelper.CanRunApplication("Content Editor/Ribbons/Chunks/Analytics - Attributes/Attributes"))
{
SheerResponse.Alert("You don't have sufficient rights for this operation");
}
else
{
NameValueCollection parameters = new NameValueCollection();
parameters["items"] = this.SerializeItems(context.Items);
parameters["fieldid"] = context.Parameters["fieldid"];
parameters["user"] = Context.User.Name;
parameters["searchString"] = context.Parameters.GetValues("url")[0].Replace("\"", string.Empty);
ClientPipelineArgs args = new ClientPipelineArgs(parameters);
if (ContinuationManager.Current != null)
ContinuationManager.Current.Start((ISupportsContinuation)this, "Run", args);
else
Context.ClientPage.Start((object)this, "Run", args);
}
}
}
开发者ID:Brandon-Royal,项目名称:Sitecore.Poc,代码行数:30,代码来源:ApplyGoalsToAllItems.cs
示例17: Run
protected void Run(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (args.IsPostBack)
{
if (args.Result == "yes")
{
var str = new ListString(args.Parameters["item"]);
foreach (string str2 in str)
{
Directory.Delete(str2, true);
}
SheerResponse.SetLocation(string.Empty);
}
}
else
{
var str3 = new ListString(args.Parameters["item"]);
if (str3.Count == 1)
{
SheerResponse.Confirm(Translate.Text("Are you sure you want to permanently delete \"{0}\"?", new object[] { str3 }));
}
else
{
SheerResponse.Confirm(Translate.Text("Are you sure you want to permanently delete these {0} items?", new object[] { str3.Count }));
}
args.WaitForPostBack();
}
}
开发者ID:udt1106,项目名称:Sitecore-Item-Buckets,代码行数:31,代码来源:RollbackDelete.cs
示例18: Run
protected void Run(ClientPipelineArgs args)
{
if (!args.IsPostBack)
{
SheerResponse.CheckModified(true);
args.WaitForPostBack();
}
else if (args.Result != "cancel")
{
if (args.HasResult && (args.Result != "cancel"))
{
if ((args.Result == "yes") || (args.Result == "no"))
{
if (args.Result == "yes")
{
this.SaveChanges();
}
SheerResponse.Input(EcmTexts.Localize("Enter the name of the new Recipient List:", new object[0]), "New Recipient List", Settings.ItemNameValidation, EcmTexts.Localize("'{0}' is not a valid name.", new object[] { "$Input" }), 100);
args.WaitForPostBack();
}
else
{
if (CreateList(args.Result))
{
NotificationManager.Instance.Notify("RefreshRecipientLists", new EventArgs());
}
else
{
SheerResponse.Alert(EcmTexts.Localize("The '{0}' list already exists, please choose another name.", new object[] { args.Result }), new string[0]);
}
}
}
}
}
开发者ID:katebutenko,项目名称:RecipientListManagement,代码行数:34,代码来源:CreateEmptyListCommand.cs
示例19: ConstrainDragTo
/// <summary>
/// This method is fired in the pipeline as a validation check before the process executes.
/// </summary>
/// <param name = "args"></param>
/// <returns></returns>
public void ConstrainDragTo(ClientPipelineArgs args)
{
//check for postback
//this occurs when an Administrator fires the event and is prompted with a confirmation message
if (args.IsPostBack)
{
if (!string.IsNullOrEmpty(args.Result) && args.Result != "yes")
{
args.AbortPipeline();
}
return;
}
//get database as listed in args
Database database = GetDatabase(args);
if (database == null) return;
//get selected item and target item
Item targetItem = GetTarget(args);
Item copiedItem = GetSource(args, database);
if (targetItem.IsNull() || copiedItem.IsNull()) return;
//validate the event
if (!MoveUtil.IsValidCopy(copiedItem, targetItem))
{
//validation failed, prompt user
MoveUtil.PromptUser(args);
}
}
开发者ID:Velir,项目名称:Sitecore-MoveValidator,代码行数:35,代码来源:CustomDragItemTo.cs
示例20: Run
protected void Run(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
Item item = DeserializeItems(args.Parameters["items"])[0];
if (args.IsPostBack)
{
if (args.HasResult)
{
string datePath = Utilities.NormalizeDate(DateTime.Now);
Item eventItem = Utilities.CreateDatePath(item, datePath);
if (eventItem != null)
{
eventItem = eventItem.Add(args.Result, new TemplateID(CalendarIDs.EventTemplate));
}
}
}
else
{
string text = "Enter the name of the new item:";
string defaultValue = "New Event";
Context.ClientPage.ClientResponse.Input(text, defaultValue, Settings.ItemNameValidation, "'$Input' is not a valid name.", 100);
args.WaitForPostBack();
}
}
开发者ID:Refactored,项目名称:SitecoreCalendarModule,代码行数:27,代码来源:CreateEventPath.cs
注:本文中的ClientPipelineArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论