本文整理汇总了C#中ISettingsProvider.Save方法的典型用法代码示例。如果您正苦于以下问题:C# ISettingsProvider.Save方法的具体用法?C# ISettingsProvider.Save怎么用?C# ISettingsProvider.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettingsProvider
的用法示例。
在下文中一共展示了ISettingsProvider.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpgradeToLatest
/// <summary>
/// Upgrades the specified settings collection to the latest structure
/// </summary>
/// <param name="settings"></param>
internal void UpgradeToLatest(ISettingsProvider settings)
{
// Deleted entries
RemoveEntry(settings, "general", "rtllang");
RemoveEntry(settings, "dvdplayer", "autoplay");
RemoveEntry(settings, "audioplayer", "autoplay");
RemoveEntry(settings, "musicfiles", "showid3");
RemoveEntry(settings, "musicfiles", "showSortButton");
RemoveEntry(settings, "musicmisc", "enqueuenext");
RemoveEntry(settings, "plugins", "Burner");
RemoveEntry(settings, "plugins", "VideoEditor");
RemoveEntry(settings, "plugins", "Foobar2000");
RemoveEntry(settings, "plugins", "AutoCropper");
RemoveEntry(settings, "plugins", "ISDN Caller-ID");
RemoveEntry(settings, "plugins", "YAC Caller-ID");
RemoveEntry(settings, "plugins", "MAME Devices");
RemoveEntry(settings, "plugins", "Last.fm Radio");
RemoveEntry(settings, "home", "Burner");
RemoveEntry(settings, "home", "VideoEditor");
RemoveEntry(settings, "home", "Last.fm Radio");
RemoveEntry(settings, "myplugins", "Burner");
RemoveEntry(settings, "myplugins", "VideoEditor");
RemoveEntry(settings, "myplugins", "Last.fm Radio");
RemoveEntry(settings, "pluginswindows", "MediaPortal.GUI.GUIBurner.GUIBurner");
RemoveEntry(settings, "pluginswindows", "WindowPlugins.VideoEditor.GUIVideoEditor");
RemoveEntry(settings, "pluginswindows", "MediaPortal.GUI.RADIOLASTFM.GUIRadioLastFM");
RemoveEntry(settings, "musicmisc", "playnowjumpto");
RemoveEntry(settings, "gui", "autosize");
RemoveEntry(settings, "debug", "useS3Hack");
RemoveEntry(settings, "general", "enables3trick");
RemoveEntry(settings, "general", "turnmonitoronafterresume");
RemoveEntry(settings, "general", "restartonresume");
RemoveEntry(settings, "audioplayer", "player");
RemoveEntry(settings, "audioplayer", "asio");
RemoveEntry(settings, "audioplayer", "asiodevice");
RemoveEntry(settings, "audioplayer", "mixing");
RemoveEntry(settings, "screenselector", "usescreenselector");
// Moved entries
MoveEntry(settings, "general", "gui", "mousesupport");
MoveEntry(settings, "general", "gui", "hideextensions");
MoveEntry(settings, "general", "gui", "allowRememberLastFocusedItem");
MoveEntry(settings, "general", "gui", "myprefix");
MoveEntry(settings, "general", "gui", "startbasichome");
MoveEntry(settings, "general", "gui", "enableguisounds");
MoveEntry(settings, "general", "gui", "ScrollSpeedRight");
MoveEntry(settings, "general", "gui", "ScrollSpeedDown");
MoveEntry(settings, "skin", "gui", "language");
MoveEntry(settings, "general", "gui", "useonlyonehome");
// blue3/wide and blue4/blue4wide are now default/wide
UpdateEntryDefaultValue(settings, "skin", "name", "Blue3", "Default");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue3wide", "DefaultWide");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue4", "Default");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue4wide", "DefaultWide");
//Mantis 3772 - Weather.com API is not free any more
//temporarily disable plugin
UpdateEntryDefaultValue(settings, "pluginswindows", "MediaPortal.GUI.Weather.GUIWindowWeather", "yes", "no");
UpdateEntryDefaultValue(settings, "plugins", "weather", "yes", "no");
ApplyDeploySettingUpgrade(settings);
settings.Save();
string skinbase = Config.GetFolder(Config.Dir.Skin) + "\\";
//Zip Blue3/Blue3Wide skin folders
string[] skins3 = { "Blue3", "Blue3Wide" };
foreach (string skin in skins3)
{
if (Directory.Exists(skinbase + skin))
{
Log.Info("Adding skin \"" + skinbase + skin + "\" to zip...");
ZipDirectory(skinbase, skin);
}
}
// Delete beta Blue4/Blue4Wide and outdated Blue3/Blue3Wide folders
string[] skins34 = { "Blue3", "Blue3Wide", "Blue4", "Blue4Wide" };
foreach (string skin in skins34)
{
if (Directory.Exists(skinbase + skin))
{
Log.Info("Deleting old skin \"" + skinbase + skin + "\"...");
Directory.Delete(skinbase + skin, true);
}
}
}
示例2: UpgradeToLatest
/// <summary>
/// Upgrades the specified settings collection to the latest structure
/// </summary>
/// <param name="settings"></param>
internal void UpgradeToLatest(ISettingsProvider settings)
{
// Deleted entries
RemoveEntry(settings, "general", "rtllang");
RemoveEntry(settings, "dvdplayer", "autoplay");
RemoveEntry(settings, "audioplayer", "autoplay");
RemoveEntry(settings, "musicfiles", "showid3");
RemoveEntry(settings, "musicfiles", "showSortButton");
RemoveEntry(settings, "musicmisc", "enqueuenext");
RemoveEntry(settings, "plugins", "Burner");
RemoveEntry(settings, "plugins", "VideoEditor");
RemoveEntry(settings, "plugins", "Foobar2000");
RemoveEntry(settings, "plugins", "AutoCropper");
RemoveEntry(settings, "plugins", "ISDN Caller-ID");
RemoveEntry(settings, "plugins", "YAC Caller-ID");
RemoveEntry(settings, "plugins", "MAME Devices");
RemoveEntry(settings, "home", "Burner");
RemoveEntry(settings, "home", "VideoEditor");
RemoveEntry(settings, "myplugins", "Burner");
RemoveEntry(settings, "myplugins", "VideoEditor");
RemoveEntry(settings, "pluginswindows", "MediaPortal.GUI.GUIBurner.GUIBurner");
RemoveEntry(settings, "pluginswindows", "WindowPlugins.VideoEditor.GUIVideoEditor");
RemoveEntry(settings, "musicmisc", "playnowjumpto");
// Moved entries
MoveEntry(settings, "general", "gui", "mousesupport");
MoveEntry(settings, "general", "gui", "hideextensions");
MoveEntry(settings, "general", "gui", "allowRememberLastFocusedItem");
MoveEntry(settings, "general", "gui", "myprefix");
MoveEntry(settings, "general", "gui", "startbasichome");
MoveEntry(settings, "general", "gui", "autosize");
MoveEntry(settings, "general", "gui", "enableguisounds");
MoveEntry(settings, "general", "gui", "ScrollSpeedRight");
MoveEntry(settings, "general", "gui", "ScrollSpeedDown");
MoveEntry(settings, "skin", "gui", "language");
MoveEntry(settings, "general", "gui", "useonlyonehome");
// blue3/wide and blue4/blue4wide are now default/wide
UpdateEntryDefaultValue(settings, "skin", "name", "Blue3", "Default");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue3wide", "DefaultWide");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue4", "Default");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue4wide", "DefaultWide");
settings.Save();
string skinbase = Config.GetFolder(Config.Dir.Skin) + "\\";
//Zip Blue3/Blue3Wide skin folders
string[] skins3 = { "Blue3", "Blue3Wide" };
foreach (string skin in skins3)
{
if (Directory.Exists(skinbase + skin))
{
Log.Info("Adding skin \"" + skinbase + skin + "\" to zip...");
ZipDirectory(skinbase, skin);
}
}
// Delete beta Blue4/Blue4Wide and outdated Blue3/Blue3Wide folders
string[] skins3_4 = { "Blue3", "Blue3Wide", "Blue4", "Blue4Wide" };
foreach (string skin in skins3_4)
{
if (Directory.Exists(skinbase + skin))
{
Log.Info("Deleting old skin \"" + skinbase + skin + "\"...");
Directory.Delete(skinbase + skin, true);
}
}
}
示例3: ApplyDeploySettingUpgrade
/// <summary>
/// Checks for the existance of deploy.xml and if it exists it applies the settings to mediaportal.xml
/// </summary>
/// <param name="settings"></param>
internal void ApplyDeploySettingUpgrade(ISettingsProvider settings)
{
var deployFile = Config.GetFile(Config.Dir.Config, "deploy.xml");
if (!File.Exists(deployFile)) return;
try
{
var deployXml = XDocument.Load(deployFile);
foreach (var deployElement in deployXml.Elements("deploySettings").Elements("deploySetting"))
{
try
{
var section = (string) deployElement.Attribute("section");
var entry = (string) deployElement.Attribute("entry");
var value = (string) deployElement;
if (!string.IsNullOrEmpty(section) && !string.IsNullOrEmpty(entry))
{
Log.Info("Apply Deploy Setting: {0} - {1} to: {2}", section, entry, value);
}
settings.SetValue(section, entry, value);
}
catch (Exception ex)
{
Log.Error("Issue applying value from deploy.xml");
Log.Error(deployElement.ToString());
Log.Error(ex);
}
}
settings.Save();
}
catch (Exception ex)
{
Log.Error("Error applying updates from deploy.xml");
Log.Error(ex);
}
}
示例4: UpgradeToLatest
/// <summary>
/// Upgrades the specified settings collection to the latest structure
/// </summary>
/// <param name="settings"></param>
internal void UpgradeToLatest(ISettingsProvider settings)
{
// Deleted entries
RemoveEntry(settings, "general", "rtllang");
RemoveEntry(settings, "dvdplayer", "autoplay");
RemoveEntry(settings, "audioplayer", "autoplay");
RemoveEntry(settings, "musicfiles", "showid3");
RemoveEntry(settings, "musicfiles", "showSortButton");
RemoveEntry(settings, "musicmisc", "enqueuenext");
RemoveEntry(settings, "plugins", "Burner");
RemoveEntry(settings, "plugins", "VideoEditor");
RemoveEntry(settings, "plugins", "Foobar2000");
RemoveEntry(settings, "plugins", "AutoCropper");
RemoveEntry(settings, "plugins", "ISDN Caller-ID");
RemoveEntry(settings, "plugins", "YAC Caller-ID");
RemoveEntry(settings, "plugins", "MAME Devices");
RemoveEntry(settings, "plugins", "Audioscrobbler");
RemoveEntry(settings, "plugins", "Last.fm Radio");
RemoveEntry(settings, "home", "Burner");
RemoveEntry(settings, "home", "VideoEditor");
RemoveEntry(settings, "home", "Last.fm Radio");
RemoveEntry(settings, "myplugins", "Burner");
RemoveEntry(settings, "myplugins", "VideoEditor");
RemoveEntry(settings, "myplugins", "Last.fm Radio");
RemoveEntry(settings, "pluginswindows", "MediaPortal.GUI.GUIBurner.GUIBurner");
RemoveEntry(settings, "pluginswindows", "WindowPlugins.VideoEditor.GUIVideoEditor");
RemoveEntry(settings, "pluginswindows", "MediaPortal.GUI.RADIOLASTFM.GUIRadioLastFM");
RemoveEntry(settings, "musicmisc", "playnowjumpto");
RemoveEntry(settings, "gui", "autosize");
RemoveEntry(settings, "debug", "useS3Hack");
RemoveEntry(settings, "general", "enables3trick");
RemoveEntry(settings, "general", "turnmonitoronafterresume");
RemoveEntry(settings, "general", "restartonresume");
RemoveEntry(settings, "audioplayer", "player");
RemoveEntry(settings, "audioplayer", "asio");
RemoveEntry(settings, "audioplayer", "asiodevice");
RemoveEntry(settings, "audioplayer", "mixing");
RemoveEntry(settings, "screenselector", "usescreenselector");
RemoveEntry(settings, "audioscrobbler", "user");
RemoveEntry(settings, "audioscrobbler", "usesimilarrandom");
RemoveEntry(settings, "audioscrobbler", "EnableNowPlaying");
RemoveEntry(settings, "audioscrobbler", "showtrayicon");
RemoveEntry(settings, "audioscrobbler", "showballontips");
RemoveEntry(settings, "audioscrobbler", "submitradiotracks");
RemoveEntry(settings, "audioscrobbler", "directskip");
RemoveEntry(settings, "audioscrobbler", "listentrycount");
RemoveEntry(settings, "audioscrobbler", "streamplayertype");
RemoveEntry(settings, "audioscrobbler", "oneclickstart");
RemoveEntry(settings, "audioscrobbler", "usesmskeyboard");
RemoveEntry(settings, "musicmisc", "fetchlastfmcovers");
RemoveEntry(settings, "musicmisc", "fetchlastfmtopalbums");
RemoveEntry(settings, "musicmisc", "lookupSimilarTracks");
RemoveEntry(settings, "musicmisc", "switchArtistOnLastFMSubmit");
RemoveEntry(settings, "musicfiles", "autoshuffle");
// Moved entries
MoveEntry(settings, "general", "gui", "mousesupport");
MoveEntry(settings, "general", "gui", "hideextensions");
MoveEntry(settings, "general", "gui", "allowRememberLastFocusedItem");
MoveEntry(settings, "general", "gui", "myprefix");
MoveEntry(settings, "general", "gui", "startbasichome");
MoveEntry(settings, "general", "gui", "enableguisounds");
MoveEntry(settings, "general", "gui", "ScrollSpeedRight");
MoveEntry(settings, "general", "gui", "ScrollSpeedDown");
MoveEntry(settings, "skin", "gui", "language");
MoveEntry(settings, "general", "gui", "useonlyonehome");
// blue3/wide and blue4/blue4wide are now default/wide
UpdateEntryDefaultValue(settings, "skin", "name", "Blue3", "Titan");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue3wide", "Titan");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue4", "Titan");
UpdateEntryDefaultValue(settings, "skin", "name", "Blue4wide", "Titan");
UpdateEntryDefaultValue(settings, "skin", "name", "Default", "Titan");
UpdateEntryDefaultValue(settings, "skin", "name", "DefaultWide", "Titan");
ApplyDeploySettingUpgrade(settings);
settings.Save();
string skinbase = Config.GetFolder(Config.Dir.Skin) + "\\";
//Zip Blue3/Blue3Wide skin folders
string[] skins3 = { "Blue3", "Blue3Wide" };
foreach (string skin in skins3)
{
if (Directory.Exists(skinbase + skin))
{
Log.Info("Adding skin \"" + skinbase + skin + "\" to zip...");
ZipDirectory(skinbase, skin);
}
}
// Delete beta Blue4/Blue4Wide and outdated Blue3/Blue3Wide folders
string[] skins34 = { "Blue3", "Blue3Wide", "Blue4", "Blue4Wide" };
foreach (string skin in skins34)
//.........这里部分代码省略.........