本文整理汇总了C#中Profile.MPSettings.GetValueAsBool方法的典型用法代码示例。如果您正苦于以下问题:C# Profile.MPSettings.GetValueAsBool方法的具体用法?C# Profile.MPSettings.GetValueAsBool怎么用?C# Profile.MPSettings.GetValueAsBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile.MPSettings
的用法示例。
在下文中一共展示了Profile.MPSettings.GetValueAsBool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public override bool Init()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
_playlistFolder = xmlreader.GetValueAsString("music", "playlists", string.Empty);
_savePlaylistOnExit = xmlreader.GetValueAsBool("musicfiles", "savePlaylistOnExit", false);
_resumePlaylistOnEnter = xmlreader.GetValueAsBool("musicfiles", "resumePlaylistOnMusicEnter", false);
playlistPlayer.RepeatPlaylist = xmlreader.GetValueAsBool("musicfiles", "repeat", true);
}
if (_resumePlaylistOnEnter)
{
Log.Info("GUIMusicPlaylist: Loading default playlist {0}", _defaultPlaylist);
bw = new BackgroundWorker();
bw.WorkerSupportsCancellation = true;
bw.WorkerReportsProgress = false;
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
bw.RunWorkerAsync();
}
else
{
defaultPlaylistLoaded = true;
}
GUIWindowManager.Receivers += new SendMessageHandler(this.OnThreadMessage);
GUIWindowManager.OnNewAction += new OnActionHandler(this.OnNewAction);
playlistPlayer.PlaylistChanged += playlistPlayer_Changed;
return Load(GUIGraphicsContext.GetThemedSkinFile(@"\myMusicplaylist.xml"));
}
示例2: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
chkboxFixScrollbar.Checked = xmlreader.GetValueAsBool("home", "scrollfixed", false);
chkBoxUseMyPlugins.Checked = xmlreader.GetValueAsBool("home", "usemyplugins", true);
chkBoxAnimation.Checked = xmlreader.GetValueAsBool("home", "enableanimation", true);
checkBoxShowSeconds.Checked = xmlreader.GetValueAsBool("home", "LongTimeFormat", false);
string text = xmlreader.GetValueAsString("home", "dateformat", "<Day> <DD>.<Month>");
cboxFormat.Items.Add(text);
if (!text.Equals("<Day> <DD>.<Month>"))
{
cboxFormat.Items.Add("<Day> <DD>.<Month>");
}
if (!text.Equals("<Day> <DD> <Month>"))
{
cboxFormat.Items.Add("<Day> <DD> <Month>");
}
if (!text.Equals("<Day> <Month> <DD>"))
{
cboxFormat.Items.Add("<Day> <Month> <DD>");
}
cboxFormat.Text = text;
}
}
示例3: LoadSettings
protected virtual void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
_fixedScroll = xmlreader.GetValueAsBool("home", "scrollfixed", true); // fix scrollbar in the middle of menu
_useMyPlugins = xmlreader.GetValueAsBool("home", "usemyplugins", true); // use previous menu handling
_enableAnimation = xmlreader.GetValueAsBool("home", "enableanimation", true);
}
}
示例4: LoadSettings
// Need change for 1.3.0
#region Serialization
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
// Mark Watched
btnMarkWatched.Selected = xmlreader.GetValueAsBool("movies", "markwatched", true);
btnKeepFoldersTogether.Selected = xmlreader.GetValueAsBool("movies", "keepfolderstogether", false);
btnCommercialSkip.Selected = xmlreader.GetValueAsBool("comskip", "automaticskip", false);
_watchedPercentage = xmlreader.GetValueAsInt("movies", "playedpercentagewatched", 95);
_videoAudioDelay = xmlreader.GetValueAsInt("FFDShow", "audiodelayInterval", 50);
}
}
示例5: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
checkBoxUseTrayIcon.Checked = xmlreader.GetValueAsBool("audioscrobbler", "showtrayicon", true);
checkBoxShowBallonTips.Checked = xmlreader.GetValueAsBool("audioscrobbler", "showballontips", true);
checkBoxSubmitToProfile.Checked = xmlreader.GetValueAsBool("audioscrobbler", "submitradiotracks", true);
checkBoxDirectSkip.Checked = xmlreader.GetValueAsBool("audioscrobbler", "directskip", false);
numericUpDownListEntries.Value = xmlreader.GetValueAsInt("audioscrobbler", "listentrycount", 24);
comboBoxStreamPlayerType.SelectedIndex = xmlreader.GetValueAsInt("audioscrobbler", "streamplayertype", 0);
checkBoxOneClickMode.Checked = xmlreader.GetValueAsBool("audioscrobbler", "oneclickstart", false);
}
}
示例6: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
btnFetchlastfmcovers.Selected = !xmlreader.GetValueAsBool("musicmisc", "fetchlastfmcovers", true);
btnFetchlastfmtopalbums.Selected = !xmlreader.GetValueAsBool("musicmisc", "fetchlastfmtopalbums", true);
btnFetchlastfmtracktags.Selected = !xmlreader.GetValueAsBool("musicmisc", "fetchlastfmtracktags", true);
btnSwitchArtistOnLastFMSubmit.Selected= xmlreader.GetValueAsBool("musicmisc", "switchArtistOnLastFMSubmit",
false);
_vuMeter= xmlreader.GetValueAsString("musicmisc", "vumeter", "none");
_vuMeter = UppercaseFirst(_vuMeter);
}
}
示例7: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
m_bAutoShuffle = xmlreader.GetValueAsBool("musicfiles", "autoshuffle", true);
}
}
示例8: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
btnDisableSimilarTrackLookup.Selected = !xmlreader.GetValueAsBool("musicmisc", "lookupSimilarTracks", true);
_vuMeter= xmlreader.GetValueAsString("musicmisc", "vumeter", "none");
_vuMeter = UppercaseFirst(_vuMeter);
}
}
示例9: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
// startup settings
_cmStartfullscreen.Selected = xmlreader.GetValueAsBool("general", "startfullscreen", true);
_cmUsefullscreensplash.Selected = xmlreader.GetValueAsBool("general", "usefullscreensplash", true);
_cmkeepstartfullscreen.Selected = xmlreader.GetValueAsBool("general", "keepstartfullscreen", false);
_cmAlwaysontop.Selected = xmlreader.GetValueAsBool("general", "alwaysontop", false);
_cmHidetaskbar.Selected = xmlreader.GetValueAsBool("general", "hidetaskbar", false);
_cmAutostart.Selected = xmlreader.GetValueAsBool("general", "autostart", false);
_cmMinimizeonstartup.Selected = xmlreader.GetValueAsBool("general", "minimizeonstartup", false);
_cmMinimizeonexit.Selected = xmlreader.GetValueAsBool("general", "minimizeonexit", false);
_cmMinimizeonfocusloss.Selected = xmlreader.GetValueAsBool("general", "minimizeonfocusloss", false);
}
}
示例10: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
m_iSpeed = xmlreader.GetValueAsInt("pictures", "speed", 3);
m_iTransistion = xmlreader.GetValueAsInt("pictures", "transition", 20);
m_iKenBurnsSpeed = xmlreader.GetValueAsInt("pictures", "kenburnsspeed", 20);
m_bKenBurns = xmlreader.GetValueAsBool("pictures", "kenburns", false);
m_bRandom = xmlreader.GetValueAsBool("pictures", "random", false);
m_bXFade = (!m_bRandom & !m_bKenBurns);
cmShuffleSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "autoShuffle", false);
cmLoopSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "autoRepeat", false);
cmExifSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "useExif", true);
cmPicasaSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "usePicasa", false);
cmGroupByDaySlideShows.Selected = xmlreader.GetValueAsBool("pictures", "useDayGrouping", false);
cmEnablePlaySlideShows.Selected = xmlreader.GetValueAsBool("pictures", "enableVideoPlayback", false);
cmPlayInSlideShows.Selected = xmlreader.GetValueAsBool("pictures", "playVideosInSlideshows", false);
}
}
示例11: LoadSettings
private void LoadSettings()
{
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
_noLargeThumbnails = xmlreader.GetValueAsBool("thumbnails", "picturenolargethumbondemand", true);
lcFolders.Clear();
_scanShare = 0;
SettingsSharesHelper settingsSharesHelper = new SettingsSharesHelper();
// Load share settings
settingsSharesHelper.LoadSettings("pictures");
foreach (GUIListItem item in settingsSharesHelper.ShareListControl)
{
string driveLetter = FolderInfo(item).Folder.Substring(0, 3).ToUpperInvariant();
if (driveLetter.StartsWith("\\\\") || Util.Utils.getDriveType(driveLetter) == 3 ||
Util.Utils.getDriveType(driveLetter) == 4)
{
item.IsPlayed = false;
if (FolderInfo(item).ScanShare)
{
item.IsPlayed = true;
item.Label2 = GUILocalizeStrings.Get(193); // Scan
_scanShare++;
}
item.OnItemSelected += OnItemSelected;
item.Label = FolderInfo(item).Folder;
item.Path = FolderInfo(item).Folder;
lcFolders.Add(item);
}
}
_defaultShare = xmlreader.GetValueAsString("pictures", "default", "");
_rememberLastFolder = xmlreader.GetValueAsBool("pictures", "rememberlastfolder", false);
_addOpticalDiskDrives = xmlreader.GetValueAsBool("pictures", "AddOpticalDiskDrives", true);
_autoSwitchRemovableDrives = xmlreader.GetValueAsBool("pictures", "SwitchRemovableDrives", true);
}
}
示例12: LoadSettings
public void LoadSettings(string section)
{
Clear();
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
string strDefault = xmlreader.GetValueAsString(section, "default", string.Empty);
for (int i = 0; i < MaximumShares; i++)
{
string strShareName = String.Format("sharename{0}", i);
string strSharePath = String.Format("sharepath{0}", i);
string strPincode = String.Format("pincode{0}", i);
string shareType = String.Format("sharetype{0}", i);
string shareServer = String.Format("shareserver{0}", i);
string shareLogin = String.Format("sharelogin{0}", i);
string sharePwd = String.Format("sharepassword{0}", i);
string sharePort = String.Format("shareport{0}", i);
string remoteFolder = String.Format("shareremotepath{0}", i);
string shareViewPath = String.Format("shareview{0}", i);
Share share = new Share();
share.Name = xmlreader.GetValueAsString(section, strShareName, string.Empty);
share.Path = xmlreader.GetValueAsString(section, strSharePath, string.Empty);
string pinCode = Utils.DecryptPin(xmlreader.GetValueAsString(section, strPincode, string.Empty));
if (pinCode != string.Empty)
share.Pincode = Convert.ToInt32(pinCode);
else
share.Pincode = -1;
share.IsFtpShare = xmlreader.GetValueAsBool(section, shareType, false);
share.FtpServer = xmlreader.GetValueAsString(section, shareServer, string.Empty);
share.FtpLoginName = xmlreader.GetValueAsString(section, shareLogin, string.Empty);
share.FtpPassword = xmlreader.GetValueAsString(section, sharePwd, string.Empty);
share.FtpPort = xmlreader.GetValueAsInt(section, sharePort, 21);
share.FtpFolder = xmlreader.GetValueAsString(section, remoteFolder, "/");
share.DefaultLayout = (Layout)xmlreader.GetValueAsInt(section, shareViewPath, (int)Layout.List);
if (share.Name.Length > 0)
{
if (strDefault == share.Name)
{
share.Default = true;
if (defaultshare == null)
{
defaultshare = share;
}
}
Add(share);
}
else break;
}
}
}
示例13: OnPageLoad
protected override void OnPageLoad()
{
base.OnPageLoad();
if (!VideoDatabase.DbHealth)
{
GUIDialogOK pDlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK);
pDlgOK.SetHeading(315);
pDlgOK.SetLine(1, string.Empty);
pDlgOK.SetLine(2, GUILocalizeStrings.Get(190010, new object[] { GUILocalizeStrings.Get(3) }));
pDlgOK.DoModal(GUIWindowManager.ActiveWindow); ;
}
if (!FolderSettings.DbHealth)
{
GUIDialogOK pDlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK);
pDlgOK.SetHeading(315);
pDlgOK.SetLine(1, string.Empty);
pDlgOK.SetLine(2, GUILocalizeStrings.Get(190010, new object[] { GUILocalizeStrings.Get(190011) }));
pDlgOK.DoModal(GUIWindowManager.ActiveWindow);
}
base.LoadSettings();
// This can't be in LoadSettings beacuse settings are loaded on MP start and it will disable SortTitle setting always
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
// Don't sort by sorttitle
_useSortTitle = xmlreader.GetValueAsBool("moviedatabase", "usesorttitle", false);
xmlreader.SetValueAsBool("moviedatabase", "usesorttitle", false);
}
if (!KeepVirtualDirectory(PreviousWindowId))
{
Reset();
}
if (!IsVideoWindow(PreviousWindowId) && IsFolderPinProtected(_cachedDir))
{
//when the user left MyVideos completely make sure that we don't use the cache
//if folder is pin protected and reload the dir completly including PIN request etc.
_cachedItems.Clear();
_cachedDir = null;
}
if (VideoState.StartWindow != GetID)
{
GUIWindowManager.ReplaceWindow(VideoState.StartWindow);
return;
}
_resetCount = 0;
// Go to default share from main MP menu
if (_currentFolder == string.Empty)
{
_currentFolder = _virtualStartDirectory;
}
LoadFolderSettings(_currentFolder);
//OnPageLoad is sometimes called when stopping playback.
//So we use the cached version of the function here.
LoadDirectory(_currentFolder, true);
}
示例14: LoadFolderSettings
private void LoadFolderSettings(string folderName)
{
if (folderName == string.Empty)
{
folderName = "root";
}
object o;
FolderSettings.GetFolderSetting(folderName, "VideoFiles", typeof(MapSettings), out o);
if (o != null)
{
_mapSettings = o as MapSettings;
if (_mapSettings == null)
{
_mapSettings = new MapSettings();
}
CurrentSortAsc = _mapSettings.SortAscending;
CurrentSortMethod = (VideoSort.SortMethod)_mapSettings.SortBy;
currentLayout = (Layout)_mapSettings.ViewAs;
}
else
{
Share share = _virtualDirectory.GetShare(folderName);
if (share != null)
{
if (_mapSettings == null)
{
_mapSettings = new MapSettings();
}
CurrentSortAsc = _mapSettings.SortAscending;
CurrentSortMethod = (VideoSort.SortMethod)_mapSettings.SortBy;
currentLayout = (Layout)share.DefaultLayout;
CurrentLayout = (Layout)share.DefaultLayout;
}
}
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
if (xmlreader.GetValueAsBool("movies", "rememberlastfolder", false))
{
xmlreader.SetValue("movies", "lastfolder", folderName);
}
}
SwitchLayout();
UpdateButtonStates();
}
示例15: LoadSettings
protected override void LoadSettings()
{
base.LoadSettings();
using (Profile.Settings xmlreader = new Profile.MPSettings())
{
currentLayout = (Layout) xmlreader.GetValueAsInt(SerializeName, "layout", (int) Layout.List);
m_bSortAscending = xmlreader.GetValueAsBool(SerializeName, "sortasc", true);
VideoState.StartWindow = xmlreader.GetValueAsInt("movies", "startWindow", GetID);
VideoState.View = xmlreader.GetValueAsString("movies", "startview", "369");
// Prevent unaccesible My Videos from corrupted config
if (!IsVideoWindow(VideoState.StartWindow))
{
VideoState.StartWindow = GetID;
VideoState.View = "369";
}
_addVideoFilesToDb = xmlreader.GetValueAsBool("gui", "addVideoFilesToDb", false);
_isFuzzyMatching = xmlreader.GetValueAsBool("movies", "fuzzyMatching", false);
_scanSkipExisting = xmlreader.GetValueAsBool("moviedatabase", "scanskipexisting", false);
_getActors = xmlreader.GetValueAsBool("moviedatabase", "getactors", true);
_markWatchedFiles = xmlreader.GetValueAsBool("movies", "markwatched", true);
//_eachFolderIsMovie = xmlreader.GetValueAsBool("movies", "eachFolderIsMovie", false);
_fileMenuEnabled = xmlreader.GetValueAsBool("filemenu", "enabled", true);
_fileMenuPinCode = Util.Utils.DecryptPassword(xmlreader.GetValueAsString("filemenu", "pincode", string.Empty));
_howToPlayAll = xmlreader.GetValueAsInt("movies", "playallinfolder", 3);
_watchedPercentage = xmlreader.GetValueAsInt("movies", "playedpercentagewatched", 95);
_videoInfoInShare = xmlreader.GetValueAsBool("moviedatabase", "movieinfoshareview", false);
_BDInternalMenu = xmlreader.GetValueAsBool("bdplayer", "useInternalBDPlayer", true);
_virtualDirectory = VirtualDirectories.Instance.Movies;
// External player
_useInternalVideoPlayer = xmlreader.GetValueAsBool("movieplayer", "internal", true);
_useInternalDVDVideoPlayer = xmlreader.GetValueAsBool("dvdplayer", "internal", true);
_externalPlayerExtensions = xmlreader.GetValueAsString("movieplayer", "extensions", "");
_wolTimeout = xmlreader.GetValueAsInt("WOL", "WolTimeout", 10);
_wolResendTime = xmlreader.GetValueAsInt("WOL", "WolResendTime", 1);
if (_virtualStartDirectory == string.Empty)
{
if (_virtualDirectory.DefaultShare != null)
{
if (_virtualDirectory.DefaultShare.IsFtpShare)
{
//remote:hostname?port?login?password?folder
_currentFolder = _virtualDirectory.GetShareRemoteURL(_virtualDirectory.DefaultShare);
_virtualStartDirectory = _currentFolder;
}
else
{
_currentFolder = _virtualDirectory.DefaultShare.Path;
_virtualStartDirectory = _virtualDirectory.DefaultShare.Path;
}
}
}
_askBeforePlayingDVDImage = xmlreader.GetValueAsBool("daemon", "askbeforeplaying", false);
if (xmlreader.GetValueAsBool("movies", "rememberlastfolder", false))
{
string lastFolder = xmlreader.GetValueAsString("movies", "lastfolder", _currentFolder);
if (VirtualDirectory.IsImageFile(Path.GetExtension(lastFolder)))
{
lastFolder = "root";
}
if (lastFolder != "root")
{
_currentFolder = lastFolder;
}
}
_switchRemovableDrives = xmlreader.GetValueAsBool("movies", "SwitchRemovableDrives", true);
_useOnlyNfoScraper = xmlreader.GetValueAsBool("moviedatabase", "useonlynfoscraper", false);
_doNotUseDatabase = xmlreader.GetValueAsBool("moviedatabase", "donotusedatabase", false);
}
if (_currentFolder.Length > 0 && _currentFolder == _virtualStartDirectory)
{
VirtualDirectory vDir = new VirtualDirectory();
vDir.LoadSettings("movies");
}
}