本文整理汇总了C#中System.IO.XmlReader.GetSettingValueAsInt方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.GetSettingValueAsInt方法的具体用法?C# XmlReader.GetSettingValueAsInt怎么用?C# XmlReader.GetSettingValueAsInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.XmlReader
的用法示例。
在下文中一共展示了XmlReader.GetSettingValueAsInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
/// <summary>
/// Loads the Settings
/// </summary>
public static void Load()
{
try
{
XmlReader xmlReader = new XmlReader();
xmlReader.Load(SettingsFile);
TraktUsername = xmlReader.GetSettingValueAsString(cTraktUsername, string.Empty);
TraktPassword = xmlReader.GetSettingValueAsString(cTraktPassword, string.Empty);
TraktOAuthToken = xmlReader.GetSettingValueAsString(cTraktOAuthToken, string.Empty);
TraktOAuth = xmlReader.GetSettingValueAsBool(cTraktOAuth, TraktPassword == string.Empty ? true : false);
TVDbAccountIdentifier = xmlReader.GetSettingValueAsString(cTVDbAccountId, string.Empty);
TMDbSessionId = xmlReader.GetSettingValueAsString(cTMDbSessionId, string.Empty);
TMDbSyncWatchlist = xmlReader.GetSettingValueAsBool(cTMDBSyncWatchlist, true);
IMDbRatingsFilename = xmlReader.GetSettingValueAsString(cIMDbRatingsFilename, string.Empty);
IMDbWatchlistFilename = xmlReader.GetSettingValueAsString(cIMDbWatchlistFilename, string.Empty);
IMDbUsername = xmlReader.GetSettingValueAsString(cIMDbUsername, string.Empty);
IMDbCustomLists = xmlReader.GetSettingValueAsString(cIMDbCustomLists, string.Empty).FromJSONArray<string>().ToList();
IMDbSyncWatchlist = xmlReader.GetSettingValueAsBool(cIMDBSyncWatchlist, false);
ListalSyncWatchlist = xmlReader.GetSettingValueAsBool(cListalSyncWatchlist, false);
ListalMovieFilename = xmlReader.GetSettingValueAsString(cListalMovieFilename, string.Empty);
ListalShowFilename = xmlReader.GetSettingValueAsString(cListalShowFilename, string.Empty);
CritickerMovieFilename = xmlReader.GetSettingValueAsString(cCritickerMovieFilename, string.Empty);
LetterboxdRatingsFilename = xmlReader.GetSettingValueAsString(cLetterboxdRatingsFilename, string.Empty);
LetterboxdWatchedFilename = xmlReader.GetSettingValueAsString(cLetterboxdWatchedFilename, string.Empty);
LetterboxdDiaryFilename = xmlReader.GetSettingValueAsString(cLetterboxdDiaryFilename, string.Empty);
FlixsterUserId = xmlReader.GetSettingValueAsString(cFlixsterUserId, string.Empty);
FlixsterSyncWantToSee = xmlReader.GetSettingValueAsBool(cFlixsterSyncWantToSee, true);
MarkAsWatched = xmlReader.GetSettingValueAsBool(cMarkAsWatched, true);
IgnoreWatchedForWatchlist = xmlReader.GetSettingValueAsBool(cIgnoreWatchedForWatchlist, true);
EnableIMDb = xmlReader.GetSettingValueAsBool(cEnableIMDb, false);
EnableTMDb = xmlReader.GetSettingValueAsBool(cEnableTMDb, false);
EnableTVDb = xmlReader.GetSettingValueAsBool(cEnableTVDb, false);
EnableListal = xmlReader.GetSettingValueAsBool(cEnableListal, false);
EnableCriticker = xmlReader.GetSettingValueAsBool(cEnableCriticker, false);
EnableLetterboxd = xmlReader.GetSettingValueAsBool(cEnableLetterboxd, false);
EnableFlixster = xmlReader.GetSettingValueAsBool(cEnableFlixster, false);
LogSeverityLevel = (LoggingSeverity)(xmlReader.GetSettingValueAsInt(cLogLevel, 3));
BatchSize = xmlReader.GetSettingValueAsInt(cBatchSize, 50);
WatchedOnReleaseDay = xmlReader.GetSettingValueAsBool(cWatchedOnReleaseDay, false);
// save settings, might be some new settings added
Save();
}
catch (Exception)
{
return;
}
}
示例2: Load
/// <summary>
/// Loads the Settings
/// </summary>
public static void Load()
{
try {
XmlReader xmlReader = new XmlReader();
xmlReader.Load(SettingsFile);
TraktUsername = xmlReader.GetSettingValueAsString(cTraktUsername, string.Empty);
TraktPassword = xmlReader.GetSettingValueAsString(cTraktPassword, string.Empty);
TVDbAccountIdentifier = xmlReader.GetSettingValueAsString(cTVDbAccountId, string.Empty);
TMDbSessionId = xmlReader.GetSettingValueAsString(cTMDbSessionId, string.Empty);
TMDbSyncWatchlist = xmlReader.GetSettingValueAsBool(cTMDBSyncWatchlist, true);
IMDbRatingsFilename = xmlReader.GetSettingValueAsString(cIMDbRatingsFilename, string.Empty);
IMDbWatchlistFilename = xmlReader.GetSettingValueAsString(cIMDbWatchlistFilename, string.Empty);
IMDbUsername = xmlReader.GetSettingValueAsString(cIMDbUsername, string.Empty);
IMDbSyncWatchlist = xmlReader.GetSettingValueAsBool(cIMDBSyncWatchlist, false);
ListalSyncWatchlist = xmlReader.GetSettingValueAsBool(cListalSyncWatchlist, false);
ListalMovieFilename = xmlReader.GetSettingValueAsString(cListalMovieFilename, string.Empty);
ListalShowFilename = xmlReader.GetSettingValueAsString(cListalShowFilename, string.Empty);
CritickerMovieFilename = xmlReader.GetSettingValueAsString(cCritickerMovieFilename, string.Empty);
MarkAsWatched = xmlReader.GetSettingValueAsBool(cMarkAsWatched, true);
IgnoreWatchedForWatchlist = xmlReader.GetSettingValueAsBool(cIgnoreWatchedForWatchlist, true);
EnableIMDb = xmlReader.GetSettingValueAsBool(cEnableIMDb, false);
EnableTMDb = xmlReader.GetSettingValueAsBool(cEnableTMDb, false);
EnableTVDb = xmlReader.GetSettingValueAsBool(cEnableTVDb, false);
EnableListal = xmlReader.GetSettingValueAsBool(cEnableListal, false);
EnableCriticker = xmlReader.GetSettingValueAsBool(cEnableCriticker, false);
LogSeverityLevel = (LoggingSeverity)(xmlReader.GetSettingValueAsInt(cLogLevel, 3));
BatchSize = xmlReader.GetSettingValueAsInt(cBatchSize, 50);
// save settings, might be some new settings added
Save();
}
catch (Exception) {
return;
}
}