本文整理汇总了C#中ClientPipelineArgs类的典型用法代码示例。如果您正苦于以下问题:C# ClientPipelineArgs类的具体用法?C# ClientPipelineArgs怎么用?C# ClientPipelineArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClientPipelineArgs类属于命名空间,在下文中一共展示了ClientPipelineArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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]);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
//}
}
示例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[] { });
}
示例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;
}
示例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);
}
}
}
示例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 + "\")");
}
}
}
}
}
示例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();
}
}
示例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]);
}
}
}
示例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();
}
}
示例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");
}
}
示例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());
}
}
}
示例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');");
}