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


C# ISettingsService.Get方法代码示例

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


在下文中一共展示了ISettingsService.Get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MainVM

        public MainVM(IApplicationManager appManager, ISettingsService settingsSvc)
        {
            _appManager = appManager;
            _settingsService = settingsSvc;

            int portNum = 1;
            if (Int32.TryParse(settingsSvc.Get("LastExternalPort"), out portNum))
                _selectedExternalPort = portNum;
            else
                _selectedExternalPort = 1;

            string lastSite = settingsSvc.Get("LastSiteName");
            if (!String.IsNullOrEmpty(lastSite) && AvailableSites.Contains(lastSite))
                _selectedSite = lastSite;
            else
                _selectedSite = AvailableSites.Count > 0 ? AvailableSites[0] : null;

            string lastPool = settingsSvc.Get("LastPoolName");
            if (!String.IsNullOrEmpty(lastPool) && AvailableSites.Contains(lastPool))
                _selectedPool = lastPool;
            else
                _selectedPool = AvailablePools.Count > 0 ? AvailablePools[0] : null;

            bool autoBrowse = true;
            if (Boolean.TryParse(_settingsService.Get("LastAutoBrowse"), out autoBrowse))
                _autoBrowse = autoBrowse;
            else
                _autoBrowse = true;

            AppConfigPath = _settingsService.Get("ConfigPath");
        }
开发者ID:scottiemc7,项目名称:IISExpressProxy,代码行数:31,代码来源:MainVM.cs

示例2: SettingsViewModel

        public SettingsViewModel(ISettingsService settingsService, IWindowManager windowManager, Func<BlogSettingsViewModel> blogSettingsCreator)
        {
            this.settingsService = settingsService;
            this.windowManager = windowManager;
            this.blogSettingsCreator = blogSettingsCreator;

            using (RegistryKey key = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Classes"))
            {
                FileMDBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[0]) &&
                    !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[0]).GetValue("").ToString());

                FileMarkdownBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[1]) &&
                    !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[1]).GetValue("").ToString());

                FileMDownBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[2]) &&
                    !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[2]).GetValue("").ToString());

                FileMKDBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[3]) &&
                    !string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[3]).GetValue("").ToString());
            }

            var blogs = settingsService.Get<List<BlogSetting>>("Blogs") ?? new List<BlogSetting>();

            Blogs = new ObservableCollection<BlogSetting>(blogs);
        }
开发者ID:ronnykarlsson,项目名称:DownmarkerWPF,代码行数:25,代码来源:SettingsViewModel.cs

示例3: MainWindow

        public MainWindow()
        {
            _settingsService = new SettingsService();

            InitializeComponent();

            var settings = _settingsService.Get();
            lblDirectory.Content = settings.LastUsedDirectory;
        }
开发者ID:holymoo,项目名称:Sweet-Show-Renamer,代码行数:9,代码来源:MainWindow.xaml.cs

示例4: SettingsViewModel

        public SettingsViewModel(ISettingsService settingsService, IWindowManager windowManager, Func<BlogSettingsViewModel> blogSettingsCreator)
        {
            this.settingsService = settingsService;
            this.windowManager = windowManager;
            this.blogSettingsCreator = blogSettingsCreator;

            using (RegistryKey key = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Classes"))
            {
                this.Extensions = Constants.DefaultExtensions
                    .Select(s => new ExtensionViewModel(s,
                        key.GetSubKeyNames().Contains(s) && !string.IsNullOrEmpty(key.OpenSubKey(s).GetValue("").ToString())))
                    .ToArray();
            }

            var blogs = settingsService.Get<List<BlogSetting>>(BlogsSettingsKey) ?? new List<BlogSetting>();

            Blogs = new ObservableCollection<BlogSetting>(blogs);

            Languages = Enum.GetValues(typeof(SpellingLanguages)).OfType<SpellingLanguages>().ToArray();
            SelectedLanguage = settingsService.Get<SpellingLanguages>(DictionariesSettingsKey);
        }
开发者ID:salloo,项目名称:DownmarkerWPF,代码行数:21,代码来源:SettingsViewModel.cs

示例5: dlg_Load

 void dlg_Load(object sender, EventArgs e)
 {
     this.settingsSvc = dlg.Services.RequireService<ISettingsService>();
     dlg.Patterns.DataSource = settingsSvc.GetList("SearchDialog/Patterns");
     if (dlg.InitialPattern != null)
         dlg.Patterns.Text = dlg.InitialPattern;
     dlg.RegexCheckbox.Checked = (int)(settingsSvc.Get("SearchDialog/Regexp", 0) ?? 0)!= 0;
     dlg.Encodings.SelectedIndex = (int)(settingsSvc.Get("SearchDialog/Encoding", 0) ?? 0);
     dlg.Scopes.SelectedIndex = (int)(settingsSvc.Get("SearchDialog/Scope", 0) ?? 0);
     dlg.ScannedMemory.Checked = (int)(settingsSvc.Get("SearchDialog/Scanned", 1) ?? 1) != 0;
     dlg.UnscannedMemory.Checked = (int)(settingsSvc.Get("SearchDialog/Unscanned", 1) ?? 1) != 0;
     EnableControls();
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:13,代码来源:SearchDialogInteractor.cs


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