本文整理汇总了C#中ClientPipelineArgs.WaitForPostBack方法的典型用法代码示例。如果您正苦于以下问题:C# ClientPipelineArgs.WaitForPostBack方法的具体用法?C# ClientPipelineArgs.WaitForPostBack怎么用?C# ClientPipelineArgs.WaitForPostBack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClientPipelineArgs
的用法示例。
在下文中一共展示了ClientPipelineArgs.WaitForPostBack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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]);
}
}
}
}
}
示例2: 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]);
}
}
}
示例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();
}
}
示例4: Run
public void Run(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
string controlId = args.Parameters["controlid"];
if (args.IsPostBack)
{
if (!args.HasResult) return;
SheerResponse.SetAttribute("scHtmlValue", "value", YouTubeVideoField.FormatValueForPageEditorDisplay(args.Result));
SheerResponse.SetAttribute("scPlainValue", "value", args.Result);
SheerResponse.Eval("scSetHtmlValue('" + controlId + "', false, true)");
}
else
{
var urlString = new UrlString(UIUtil.GetUri(DialogUrl));
urlString["val"] = args.Parameters.Get("fieldValue");
Context.ClientPage.ClientResponse.ShowModalDialog(urlString.ToString(), "650px", "700px", string.Empty, true);
args.WaitForPostBack();
}
}
示例5: 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());
}
}
}
示例6: 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();
}
示例7: Upload
public static void Upload(ClientPipelineArgs args, Edit fileEdit)
{
try
{
CheckPackageFolder();
if (!args.IsPostBack)
{
UploadPackageForm.Show(ApplicationContext.PackagePath, true);
args.WaitForPostBack();
}
else
{
if (args.Result.StartsWith("ok:", StringComparison.InvariantCulture))
{
string[] strArray = args.Result.Substring("ok:".Length).Split('|');
if (strArray.Length >= 1 && fileEdit != null)
{
fileEdit.Value = strArray[0];
}
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message, typeof(DialogUtils));
SheerResponse.Alert(ex.Message);
}
}
示例8: Execute
public new void Execute(ClientPipelineArgs args)
{
var item = Context.ContentDatabase.GetItem(args.Parameters[1]);
if (item.IsNotNull())
{
Error.AssertItem(item, "item");
if (!args.IsPostBack)
{
if (item.IsABucket())
{
new ClientResponse().Confirm("You are about to delete an item which is an item bucket with lots of hidden items below it. Are you sure you want to do this?");
args.WaitForPostBack();
}
}
else
{
if (args.Result != "yes")
{
args.AbortPipeline();
args.Result = string.Empty;
args.IsPostBack = false;
return;
}
Event.RaiseEvent("item:bucketing:deleting", args, this);
}
}
}
示例9: Run
protected static void Run(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (SheerResponse.CheckModified())
{
if (args.IsPostBack)
{
SheerResponse.Eval("window.top.location.href=window.top.location.href");
var itemId = ParseForAttribute(args.Result, "id");
Item item = Sitecore.Context.ContentDatabase.GetItem(itemId);
if (item.IsNotNull())
{
var url =
new UrlString("http://" + HttpContext.Current.Request.Url.Host +
LinkManager.GetItemUrl(item).Replace("/sitecore/shell", ""));
WebEditCommand.Reload(url);
}
}
else
{
SheerResponse.ShowModalDialog(
new UrlString("/sitecore/shell/Applications/Dialogs/Bucket%20link.aspx?").ToString(), "1000", "700", "", true);
args.WaitForPostBack();
}
}
}
示例10: Run
/// <summary>
/// If postback: sets profile key to supplied value
/// Otherwise: prompt user for new value
/// </summary>
/// <param name="args">The args.</param>
protected void Run(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
Assert.ArgumentNotNull(args.Parameters["profilename"], "profilename");
Assert.ArgumentNotNull(args.Parameters["profilekey"], "profilekey");
if (args.IsPostBack)
{
if (args.HasResult)
{
int profileKeyValue;
if(int.TryParse(args.Result,out profileKeyValue))
{
PersonaHelper personaHelper = PersonaHelper.GetHelper();
personaHelper.UpdateProfileKey(args.Parameters["profilename"], args.Parameters["profilekey"], profileKeyValue);
SheerResponse.Redraw();
}
}
}
else
{
Context.ClientPage.ClientResponse.Input("Please enter new profile key value.", "0");
args.WaitForPostBack();
}
}
示例11: 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);
}
}
//}
}
示例12: 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();
}
}
示例13: SelectFields
public void SelectFields(ClientPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (!args.IsPostBack)
{
UrlString urlString = new UrlString(UIUtil.GetUri("control:TreeListExEditor"));
UrlHandle urlHandle = new UrlHandle();
urlHandle["title"] = PullUpFieldsSettings.SelectFieldsDialogTitle;
urlHandle["text"] = PullUpFieldsSettings.SelectFieldsDialogText;
urlHandle["source"] = GetSelectFieldsDialogSource(args);
urlHandle.Add(urlString);
SheerResponse.ShowModalDialog
(
urlString.ToString(),
PullUpFieldsSettings.SelectFieldsDialogWidth,
PullUpFieldsSettings.SelectFieldsDialogHeight,
string.Empty,
true
);
args.WaitForPostBack();
}
else if (args.HasResult)
{
args.Parameters["fieldIds"] = args.Result;
args.IsPostBack = false;
}
else
{
CancelOperation(args);
}
}
示例14: 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();
}
}
示例15: Run
protected void Run(ClientPipelineArgs args)
{
string str = args.Parameters["id"];
string name = args.Parameters["language"];
string str3 = args.Parameters["version"];
var version = Sitecore.Data.Version.Parse(str3);
Item item = Context.ContentDatabase.GetItem(str, Sitecore.Globalization.Language.Parse(name), version);
Error.AssertItemFound(item);
if (!SheerResponse.CheckModified()) return;
if (!args.IsPostBack)
{
string forItemPageURL = Sitecore.Configuration.Settings.GetSetting("SCBasics.AuditTrail.ForItemPageURL");
if (!string.IsNullOrWhiteSpace(forItemPageURL))
{
Sitecore.Text.UrlString url = new Sitecore.Text.UrlString(
forItemPageURL);
url.Append("id", HttpUtility.UrlEncode(args.Parameters["id"]));
url.Append("la", HttpUtility.UrlEncode(args.Parameters["language"]));
url.Append("ve", HttpUtility.UrlEncode(args.Parameters["version"]));
Sitecore.Context.ClientPage.ClientResponse.ShowModalDialog(url.ToString(),
"990px", "570px",
"ForItemPageURL", true);
args.WaitForPostBack();
}
else
{
SheerResponse.Alert("SCBasics.AuditTrail.ForItemPageURL is empty. Please verify your configurations", true);
}
}
}