当前位置: 首页>>代码示例>>C#>>正文


C# XmlReader.GetSettingValueAsBool方法代码示例

本文整理汇总了C#中System.IO.XmlReader.GetSettingValueAsBool方法的典型用法代码示例。如果您正苦于以下问题:C# XmlReader.GetSettingValueAsBool方法的具体用法?C# XmlReader.GetSettingValueAsBool怎么用?C# XmlReader.GetSettingValueAsBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.XmlReader的用法示例。


在下文中一共展示了XmlReader.GetSettingValueAsBool方法的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;
            }
        }
开发者ID:damienhaynes,项目名称:TraktRater,代码行数:52,代码来源:Settings.cs

示例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;
            }
        }
开发者ID:kheyse,项目名称:TraktRater,代码行数:39,代码来源:Settings.cs


注:本文中的System.IO.XmlReader.GetSettingValueAsBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。