本文整理汇总了C#中WhiteCore.Modules.Web.WebInterface.SaveWebUISettings方法的典型用法代码示例。如果您正苦于以下问题:C# WebInterface.SaveWebUISettings方法的具体用法?C# WebInterface.SaveWebUISettings怎么用?C# WebInterface.SaveWebUISettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhiteCore.Modules.Web.WebInterface
的用法示例。
在下文中一共展示了WebInterface.SaveWebUISettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fill
public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
ITranslator translator, out string response)
{
response = null;
var vars = new Dictionary<string, object>();
var settings = webInterface.GetWebUISettings();
if (requestParameters.ContainsKey("Submit"))
{
settings.WebRegistration = requestParameters["WebRegistration"].ToString() == "1";
settings.MapCenter.X = int.Parse(requestParameters["GridCenterX"].ToString());
settings.MapCenter.Y = int.Parse(requestParameters["GridCenterY"].ToString());
settings.LocalFrontPage = requestParameters["LocalFrontPage"].ToString();
if (settings.LocalFrontPage != "")
settings.LocalFrontPage = "local/" + settings.LocalFrontPage;
settings.LocalCSS = requestParameters["LocalCSS"].ToString();
settings.HideSlideshowBar = requestParameters["HideSlideshowBar"].ToString() == "1";
settings.HideLanguageTranslatorBar = requestParameters["HideLanguageBar"].ToString() == "1";
settings.HideStyleBar = requestParameters["HideStyleBar"].ToString() == "1";
if (settings.LocalCSS != "")
{
settings.LocalCSS = "local/" + settings.LocalCSS;
settings.HideStyleBar = true; // not needed if a local style is used
}
webInterface.SaveWebUISettings (settings);
response = "Successfully updated WebUI settings.";
return null;
}
else if (requestParameters.ContainsKey("IgnorePagesUpdates"))
{
settings.LastPagesVersionUpdateIgnored = PagesMigrator.CurrentVersion;
webInterface.SaveWebUISettings (settings);
}
else if (requestParameters.ContainsKey("IgnoreSettingsUpdates"))
{
settings.LastSettingsVersionUpdateIgnored = PagesMigrator.CurrentVersion;
webInterface.SaveWebUISettings (settings);
}
vars.Add("WebRegistrationNo", !settings.WebRegistration ? "selected=\"selected\"" : "");
vars.Add("WebRegistrationYes", settings.WebRegistration ? "selected=\"selected\"" : "");
vars.Add("GridCenterX", settings.MapCenter.X);
vars.Add("GridCenterY", settings.MapCenter.Y);
if (settings.LocalFrontPage.StartsWith("local/"))
vars.Add("LocalFrontPage", settings.LocalFrontPage.Remove(0,6)); // remove 'local/' prefix
else
vars.Add("LocalFrontPage", settings.LocalFrontPage);
if (settings.LocalCSS.StartsWith("local/"))
vars.Add("LocalCSS", settings.LocalCSS.Remove(0,6)); // remove 'local/' prefix
else
vars.Add("LocalCSS", settings.LocalCSS);
vars.Add("HideSlideshowBarNo", !settings.HideSlideshowBar ? "selected=\"selected\"" : "");
vars.Add("HideSlideshowBarYes", settings.HideSlideshowBar ? "selected=\"selected\"" : "");
vars.Add("HideLanguageBarNo", !settings.HideLanguageTranslatorBar ? "selected=\"selected\"" : "");
vars.Add("HideLanguageBarYes", settings.HideLanguageTranslatorBar ? "selected=\"selected\"" : "");
vars.Add("HideStyleBarNo", !settings.HideStyleBar ? "selected=\"selected\"" : "");
vars.Add("HideStyleBarYes", settings.HideStyleBar ? "selected=\"selected\"" : "");
vars.Add("IgnorePagesUpdates",
PagesMigrator.CheckWhetherIgnoredVersionUpdate(settings.LastPagesVersionUpdateIgnored)
? ""
: "checked");
vars.Add("IgnoreSettingsUpdates",
settings.LastSettingsVersionUpdateIgnored != SettingsMigrator.CurrentVersion ? "" : "checked");
vars.Add("SettingsManager", translator.GetTranslatedString("SettingsManager"));
vars.Add("IgnorePagesUpdatesText", translator.GetTranslatedString("IgnorePagesUpdatesText"));
vars.Add("IgnoreSettingsUpdatesText", translator.GetTranslatedString("IgnoreSettingsUpdatesText"));
vars.Add("WebRegistrationText", translator.GetTranslatedString("WebRegistrationText"));
vars.Add("GridCenterXText", translator.GetTranslatedString("GridCenterXText"));
vars.Add("GridCenterYText", translator.GetTranslatedString("GridCenterYText"));
vars.Add("LocalFrontPageText", translator.GetTranslatedString("LocalFrontPageText"));
vars.Add("LocalCSSText", translator.GetTranslatedString("LocalCSSText"));
vars.Add("WelcomeMessageText", translator.GetTranslatedString("WelcomeMessageText"));
vars.Add("HideSlideshowBarText", translator.GetTranslatedString("HideSlideshowBarText"));
vars.Add("HideLanguageBarText", translator.GetTranslatedString("HideLanguageBarText"));
vars.Add("HideStyleBarText", translator.GetTranslatedString("HideStyleBarText"));
vars.Add("Save", translator.GetTranslatedString("Save"));
vars.Add("No", translator.GetTranslatedString("No"));
vars.Add("Yes", translator.GetTranslatedString("Yes"));
return vars;
}