コード例 #1
0
ファイル: PublishSProcCommand.cs プロジェクト: Microsoft/RTVS
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) {
     _appShell = appShell;
     _pss = pss;
     _fs = fs;
     _dacServicesProvider = dacServicesProvider;
     _settings = settings;
 }
コード例 #2
0
ファイル: SettingsGroup.cs プロジェクト: fotisp/conqat
 /// <summary>
 /// Dispose of this group by disposing of it's storage implementation
 /// </summary>
 public void Dispose()
 {
     if ( storage != null )
     {
         storage.Dispose();
         storage = null;
     }
 }
コード例 #3
0
 public void Save(ISettingsStorage settingsStorage) {
     settingsStorage.SetSetting(TargetTypeSettingName, TargetType);
     settingsStorage.SetSetting(TargetDatabaseConnectionSettingName, TargetDatabaseConnection);
     settingsStorage.SetSetting(TargetProjectSettingName, TargetProject);
     settingsStorage.SetSetting(TableNameSettingName, TableName);
     settingsStorage.SetSetting(CodePlacementSettingName, CodePlacement);
     settingsStorage.SetSetting(QuoteTypeSettingName, QuoteType);
 }
コード例 #4
0
        private SqlPublshOptionsDialog(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
            _appShell = appShell;
            _pss = pss;
            _pcsp = pcsp;
            _settings = settings;

            Title = Package.Resources.SqlPublishDialog_Title;
        }
コード例 #5
0
 private void Load(ISettingsStorage settingsStorage) {
     TargetType = settingsStorage.GetSetting(TargetTypeSettingName, PublishTargetType.Dacpac);
     TargetDatabaseConnection = settingsStorage.GetSetting(TargetDatabaseConnectionSettingName, string.Empty);
     TargetProject = settingsStorage.GetSetting(TargetProjectSettingName, string.Empty);
     TableName = settingsStorage.GetSetting(TableNameSettingName, DefaultRCodeTableName);
     CodePlacement = settingsStorage.GetSetting(CodePlacementSettingName, RCodePlacement.Inline);
     QuoteType = settingsStorage.GetSetting(QuoteTypeSettingName, SqlQuoteType.None);
 }
コード例 #6
0
 private void Load(ISettingsStorage settingsStorage)
 {
     TargetType = settingsStorage.GetSetting(TargetTypeSettingName, PublishTargetType.Dacpac);
     TargetDatabaseConnection = settingsStorage.GetSetting(TargetDatabaseConnectionSettingName, string.Empty);
     TargetProject            = settingsStorage.GetSetting(TargetProjectSettingName, string.Empty);
     TableName     = settingsStorage.GetSetting(TableNameSettingName, DefaultRCodeTableName);
     CodePlacement = settingsStorage.GetSetting(CodePlacementSettingName, RCodePlacement.Inline);
     QuoteType     = settingsStorage.GetSetting(QuoteTypeSettingName, SqlQuoteType.None);
 }
コード例 #7
0
 public void Save(ISettingsStorage settingsStorage)
 {
     settingsStorage.SetSetting(TargetTypeSettingName, TargetType);
     settingsStorage.SetSetting(TargetDatabaseConnectionSettingName, TargetDatabaseConnection);
     settingsStorage.SetSetting(TargetProjectSettingName, TargetProject);
     settingsStorage.SetSetting(TableNameSettingName, TableName);
     settingsStorage.SetSetting(CodePlacementSettingName, CodePlacement);
     settingsStorage.SetSetting(QuoteTypeSettingName, QuoteType);
 }
コード例 #8
0
ファイル: SqlSProcPublishSettings.cs プロジェクト: jflam/RTVS
 private void Load(ISettingsStorage settingsStorage)
 {
     TargetType = (PublishTargetType)settingsStorage.GetInteger(TargetTypeSettingName, (int)PublishTargetType.Dacpac);
     TargetDatabaseConnection = settingsStorage.GetString(TargetDatabaseConnectionSettingName, string.Empty);
     TargetProject            = settingsStorage.GetString(TargetProjectSettingName, string.Empty);
     TableName     = settingsStorage.GetString(TableNameSettingName, SqlSProcPublishSettings.DefaultRCodeTableName);
     CodePlacement = (RCodePlacement)settingsStorage.GetInteger(CodePlacementSettingName, (int)RCodePlacement.Inline);
     QuoteType     = (SqlQuoteType)settingsStorage.GetInteger(QuoteTypeSettingName, (int)SqlQuoteType.None);
 }
コード例 #9
0
 public PublishSProcOptionsCommand(IApplicationShell appShell, IProjectSystemServices pss, 
                                   IProjectConfigurationSettingsProvider pcsp, IDacPackageServicesProvider dacServicesProvider,
                                   ISettingsStorage settings) {
     _appShell = appShell;
     _pss = pss;
     _pcsp = pcsp;
     _dacServicesProvider = dacServicesProvider;
     _settings = settings;
 }
コード例 #10
0
        public MainViewModel(IMissionSourceFactory factory, ISettingsStorage settingsStorage)
        {
            _synchronizationContext = SynchronizationContext.Current;
            _missionSourceFactory   = factory;
            _settingsStorage        = settingsStorage;

            SetupCommands();
            RetrieveSavedSettings();
        }
コード例 #11
0
        private SqlPublshOptionsDialog(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings)
        {
            _appShell = appShell;
            _pss      = pss;
            _pcsp     = pcsp;
            _settings = settings;

            Title = Package.Resources.SqlPublishDialog_Title;
        }
コード例 #12
0
 public UserStorage(
     ILogger logger,
     ISettingsStorage storage,
     UserSettings userSettings)
 {
     _logger       = logger;
     _storage      = storage;
     _userSettings = userSettings;
 }
コード例 #13
0
 public FastWidgetController(IDataStorage storage, ISettingsStorage settings, FinanceHelper financeHelper, ConvertHelper converter, ICurrencyClient currency, UsersHelper usersHelper)
 {
     _storage       = storage;
     _settings      = settings;
     _financeHelper = financeHelper;
     _converter     = converter;
     _currency      = currency;
     _usersHelper   = usersHelper;
 }
コード例 #14
0
        public static async Task<SqlPublshOptionsDialog> CreateAsync(
            IApplicationShell appShell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
            var dialog = await CreateAsync(appShell, pss, new FileSystem(), pcsp, settings);

            await appShell.SwitchToMainThreadAsync();
            dialog.InitializeComponent();
            dialog.InitializeUI();
            return dialog;
        }
コード例 #15
0
        public static void SavePropertyValues(this ISettingsStorage settings, object o)
        {
            var dict = o.GetPropertyValueDictionary();

            foreach (var kvp in dict)
            {
                settings.SetSetting(kvp.Key, kvp.Value);
            }
        }
コード例 #16
0
 public SenderFiles(
     IWorkFlowProducerConsumer consumer,
     ISettingsStorage settings,
     IConsoleService console,
     Proxy proxy)
     : base(consumer, settings, console)
 {
     _proxy = proxy.CreateRemoteProxy <IRemoteInteraction>();
     _console.AddEvent($"{nameof(SenderFiles)} ready.");
 }
コード例 #17
0
        public void SubstorageSettingsPUT1([PexAssumeUnderTest] MemorySettingsStorage storage1, [PexAssumeUnderTest] String subStorageName, [PexAssumeUnderTest] String settingName, [PexAssumeNotNull] Object settingValue)
        {
            ISettingsStorage sub = storage1.MakeChildStorage(subStorageName);

            sub.SaveSetting(settingName, settingValue);
            PexAssert.AreEqual(settingValue, sub.GetSetting(settingName));

            sub.RemoveSetting(settingName);
            PexAssert.IsNull(sub.GetSetting(settingName));
        }
コード例 #18
0
ファイル: SettingsForm.cs プロジェクト: nikita-v/Screenshoter
 public SettingsForm(ISettingsStorage settingsStorage)
 {
     InitializeComponent();
     this.settingsStorage = settingsStorage;
     String savedPath = settingsStorage.GetValue(SettingsKeys.OutputDirectoryKey);
     if (savedPath != null)
     {
         pathTextBox.Text = savedPath;
     }
 }
コード例 #19
0
ファイル: KdbPlusProcessBuilder.cs プロジェクト: sv/kp.net
        /// <summary>
        /// Sets the settings storage.
        /// </summary>
        /// <param name="storage">The storage.</param>
        /// <returns>Itself.</returns>
        public KdbPlusProcessBuilder SetSettingsStorage(ISettingsStorage storage)
        {
            ThrowExceptionfIfProcessCreated();

            Guard.ThrowIfNull(storage, "storage");

            _settingsStorage = storage;

            return(this);
        }
コード例 #20
0
        public PageLogin()
        {
            InitializeComponent();

            if (!this.DesignMode)
            {
                store    = new PortableStorage();//保存在本地计算机
                settings = new SettingsProvider(store);
            }
        }
コード例 #21
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="settingsStorage">Хранилище настроек, где указаны директории для синхронизации.</param>
        /// <param name="synchronizedItemFactory">Фабрика для создания отслеживаемых элементов.</param>
        public SynchronizedDirectoriesManager(ISettingsStorage settingsStorage, ISynchronizedItemFactory synchronizedItemFactory,
                                              ISynchronizedItemsStatusAndCommandsUpdater synchronizedItemsStatusAndCommandsUpdater)
        {
            (_settingsStorage, _synchronizedItemFactory, _synchronizedItemsStatusAndCommandsUpdater) =
                (settingsStorage, synchronizedItemFactory, synchronizedItemsStatusAndCommandsUpdater);

            _synchronizedDirectoriesList = settingsStorage.SettingsRows.Where(r => r.IsUsed).Select(
                r => new SynchronizedItems(r, _synchronizedItemFactory, _synchronizedItemsStatusAndCommandsUpdater)).ToList();
            _synchronizedDirectoriesListForLoad = new List <SynchronizedItems>(_synchronizedDirectoriesList);
        }
コード例 #22
0
ファイル: Settings.cs プロジェクト: Verturin/GSAKWrapper
 public void ReloadSettings()
 {
     if (_settingsStorage != null)
     {
         _settingsStorage.Dispose();
         _settingsStorage = null;
     }
     _settingsStorage = new SqliteSettingsStorage();
     _settings        = _settingsStorage.LoadSettings();
 }
コード例 #23
0
 public PublishSProcOptionsCommand(IApplicationShell appShell, IProjectSystemServices pss,
                                   IProjectConfigurationSettingsProvider pcsp, IDacPackageServicesProvider dacServicesProvider,
                                   ISettingsStorage settings)
 {
     _appShell            = appShell;
     _pss                 = pss;
     _pcsp                = pcsp;
     _dacServicesProvider = dacServicesProvider;
     _settings            = settings;
 }
コード例 #24
0
 public DbContextScope(ILocalCache cache, ISettingsStorage settingsStorage) {
     _parentScope = GetAmbientScope();
     _cache = cache;
     if (_parentScope == null) {
         _gameContext = new Lazy<IGameContext>(Factory);
         _settingsContext = new Lazy<ISettingsStorage>(() => settingsStorage);
         _contentLinkContext = new Lazy<IContentFolderLinkContext>(() => new ContentFolderLinkContext(Common.Paths.LocalDataPath.GetChildFileWithName("folderlink.json")));
     } else
         _nested = true;
     SetAmbientScope(this);
 }
コード例 #25
0
 public void ReloadSettings()
 {
     if (_settingsStorage != null)
     {
         _settingsStorage.Dispose();
         _settingsStorage = null;
     }
     _settingsStorage = new SqliteSettingsStorage();
     _settings        = _settingsStorage.LoadSettings();
     SettingsFolder   = (_settingsStorage as SqliteSettingsStorage).RootSettingsFolder;
 }
コード例 #26
0
        public ApplicationSettings(ISettingsStorage storage)
        {
            _storage = storage;

            if (!_storage.TryGetValue <ApplicationSettings>(StorageKey, out var oldSettings))
            {
                oldSettings = Default;
            }

            CreateMapper().Map(oldSettings, this);
        }
コード例 #27
0
        //---------------------------------------------------------------------
        static MainSettingController CreateController(
            StartUpProjectSettings settings,
            IOpenCppCoverageCmdLine openCppCoverageCmdLine,
            Mock <IStartUpProjectSettingsBuilder> builder,
            ISettingsStorage settingsStorage)
        {
            var controller = new MainSettingController(settingsStorage, openCppCoverageCmdLine, builder.Object, null);

            builder.Setup(b => b.ComputeSettings(ProjectSelectionKind.StartUpProject)).Returns(settings);
            return(controller);
        }
コード例 #28
0
        public PageReport()
        {
            InitializeComponent();

            if (!this.DesignMode)
            {
                // PortableStorage: 在运行程序目录创建一个setting的文件记录参数数据
                store    = new PortableStorage();
                settings = new SettingsProvider(store);
            }
        }
コード例 #29
0
        public ActGridControl(
            IConsoleService console,
            ISettingsStorage settings)
        {
            _console  = console;
            _settings = settings;

            InitializeComponent();
            //_fastAccess = new Dictionary<int, Guid>();
            CreateFields <FlatAct>();
        }
コード例 #30
0
        protected WorkFlowDecoratorBase(
            IWorkFlowProducerConsumer consumer,
            ISettingsStorage settings,
            IConsoleService console)
            : base(settings, console)
        {
            _consumer = consumer ?? throw new ArgumentNullException(nameof(consumer));

            _queue           = new ConcurrentQueue <FileTransferInfo>();
            CancelationToken = WorkFlowCancelationToken.Ready;
        }
コード例 #31
0
 public JsonReadFiles(
     ISettingsStorage settings,
     IConsoleService console,
     IWorkFlowProducerConsumer consumer,
     DbContext context,
     IUnityContainer container)
     : base(consumer, settings, console)
 {
     _context = (ModelContext)context;
     _console.AddEvent($"{nameof(JsonReadFiles)} ready.");
 }
コード例 #32
0
        public PageEmail()
        {
            InitializeComponent();

            if (!this.DesignMode)
            {
                //DatabaseStorage:在数据库里面,以指定用户标识保存参数数据
                string creator = Portal.gc.LoginUserInfo.Name;
                store    = new DatabaseStorage(creator);
                settings = new SettingsProvider(store);
            }
        }
コード例 #33
0
ファイル: Host.cs プロジェクト: Ekstrem/OverWeightControl
        public Host(
            IConsoleService console,
            ISettingsStorage settings,
            IUnityContainer container)
        {
            _console   = console;
            _settings  = settings;
            _container = container;

            _hosts = new ConcurrentDictionary <Type, ServiceHost>();
            FindAndHost()
            .ForEach(e => HostService(e.Value, e.Key));
        }
コード例 #34
0
 public RecivingFiles(
     ISettingsStorage settings,
     IConsoleService console,
     Host host)
     : base(settings, console)
 {
     _host = host;
     if (s_ownBlackJackQueue == null)
     {
         s_ownBlackJackQueue = new ConcurrentQueue <FileTransferInfo>();
     }
     _console.AddEvent($"{nameof(RecivingFiles)} ready.");
 }
コード例 #35
0
 public DbContexts(ILocalCache cache, Func <ApiContext> apiCacheCreator, ISettingsStorage settingsStorage)
 {
     _cache              = cache;
     _apiCacheCreator    = apiCacheCreator;
     _gameContext        = new Lazy <IGameContext>(Factory);
     _apiContext         = new Lazy <IApiContext>(ApiFactory);
     _settingsContext    = new Lazy <ISettingsStorage>(() => settingsStorage);
     _contentLinkContext =
         new Lazy <IContentFolderLinkContext>(
             () =>
             new ContentFolderLinkContext(
                 Common.Paths.LocalDataPath.GetChildFileWithName("folderlink.json")));
 }
コード例 #36
0
        public ApplicationSettings(ISettingsStorage settingsStorage)
        {
            _settingsStorage = settingsStorage;

            if (Servers == null)
            {
                Servers = new Dictionary <string, Server>();
            }

            if (UserNames == null)
            {
                UserNames = new Dictionary <string, string>();
            }
        }
コード例 #37
0
        public SettingsViewModel(IDialogService dialogService, IMessagingService messagingService, IBackupRestoreService backupRestoreService,
                                 ISettingsStorage settingsStorage, ΙStatistics statistics, IExporter exporter)
        {
            _dialogService        = dialogService;
            _messagingService     = messagingService;
            _settingsStorage      = settingsStorage;
            _statistics           = statistics;
            _exporter             = exporter;
            _backupRestoreService = backupRestoreService;

            Title = AppResources.SettingsTitle;

            SelectItemCommand = new Command <Preference>(OnItemSelected);
        }
コード例 #38
0
 public virtual void Initialize(ISettingsStorage settingsStorage)
 {
     Assert.ArgumentNotNull(settingsStorage, "settingsStorage");
       this.SettingsStorage = settingsStorage;
       this.SettingsStorage.LoadSettings();
       this.RootContainer = this.SettingsStorage.GetRootContainer();
       this.RootBox = this.GetRootBox(this.RootContainer);
       var autosaveInterval = this.AutoSaveInterval;
       if (autosaveInterval > 0)
       {
     this.TimerForAutosave = new Timer(autosaveInterval * 1000);
     this.TimerForAutosave.Elapsed += this.TimerForAutosave_Elapsed;
     this.TimerForAutosave.Enabled = true;
       }
 }
コード例 #39
0
        public static void LoadPropertyValues(this ISettingsStorage settings, object o)
        {
            var properties = o.GetType().GetTypeInfo().GetProperties();

            foreach (var p in properties)
            {
                if (settings.SettingExists(p.Name))
                {
                    try {
                        var value = settings.GetSetting(p.Name, p.PropertyType);
                        p.SetValue(o, value);
                    } catch (ArgumentException) { } // protect from settings store damage
                }
            }
        }
コード例 #40
0
ファイル: Settings.cs プロジェクト: Confectrician/GSAKWrapper
 public Settings()
 {
     #if DEBUG
     if (_uniqueInstance != null)
     {
         //you used the wrong binding
         //use:
         //<properties:Settings x:Key="Settings" />
         //{Binding ArchivedRowColor, Source={x:Static p:Settings.Default}}
         System.Diagnostics.Debugger.Break();
     }
     #endif
     SqliteSettingsStorage.ApplicationRunning = Settings.ApplicationRunning;
     _settingsStorage = new SqliteSettingsStorage();
     _settings = _settingsStorage.LoadSettings();
 }
コード例 #41
0
        protected WorkFlowBase(
            ISettingsStorage settings,
            IConsoleService console)
        {
            if (settings == null)
            {
                new ArgumentNullException(nameof(settings));
            }
            _settings = settings;

            if (console == null)
            {
                new ArgumentNullException(nameof(console));
            }
            _console = console;
        }
コード例 #42
0
        public SettingsProviderTests()
        {
            applicationSettingsStore = Substitute.For<ISettingsStorage>();
            backingStore = new Dictionary<string, string>();
            applicationSettingsStore.Load("TestSettings.settings").Returns(backingStore);
            applicationSettingsStore
                .When(s=>s.Save("TestSettings.settings", Arg.Any<Dictionary<string, string>>()))
                .Do(c=>
                    {
                        backingStore.Clear();
                        foreach (var setting in c.Arg<Dictionary<string, string>>())
                        {
                            backingStore.Add(setting.Key, setting.Value);
                        }
                    });

            settingsRetreiver = new SettingsProvider(applicationSettingsStore);
            settingsSaver = new SettingsProvider(applicationSettingsStore);
        }
コード例 #43
0
 public static bool GetValidationEnabled(ISettingsStorage storage) {
     return storage.GetBoolean(ValidationEnabledKey, true);
 }
コード例 #44
0
 public MainViewModel(ISettingsStorage settings, IDarumaApplicationService darumaService) 
 {
     _settings = settings;
     _darumaService = darumaService;
 }
コード例 #45
0
ファイル: Settings.cs プロジェクト: Confectrician/GSAKWrapper
 public void PrepareReloadSettings()
 {
     if (_settingsStorage != null)
     {
         _settingsStorage.Dispose();
         _settingsStorage = null;
     }
 }
コード例 #46
0
 public LegacySettingsConverter( ISettingsStorage legacy, ISettingsStorage current )
     : base(current)
 {
     this.legacy = legacy;
     this.current = current;
 }
コード例 #47
0
 public TokenRefresher(IOauthConnect connect, IMediator mediator, ISettingsStorage storage) {
     _connect = connect;
     _storage = storage;
     _premiumRefresher = new PremiumHandler(mediator, storage);
 }
コード例 #48
0
 public void Initialize(ISettingsStorage settingsStorage)
 {
     this.settingsStorage = settingsStorage;
 }
コード例 #49
0
ファイル: Settings.cs プロジェクト: Confectrician/GSAKWrapper
 public void ReloadSettings()
 {
     if (_settingsStorage != null)
     {
         _settingsStorage.Dispose();
         _settingsStorage = null;
     }
     _settingsStorage = new SqliteSettingsStorage();
     _settings = _settingsStorage.LoadSettings();
 }
コード例 #50
0
 public static async Task<SqlPublshOptionsDialog> CreateAsync(
     IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IProjectConfigurationSettingsProvider pcsp, ISettingsStorage settings) {
     var dialog = new SqlPublshOptionsDialog(appShell, pss, fs, pcsp, settings);
     await dialog.InitializeModelAsync();
     return dialog;
 }
コード例 #51
0
 public void ReloadSettings()
 {
     if (_settingsStorage != null)
     {
         _settingsStorage.Dispose();
         _settingsStorage = null;
     }
     _settingsStorage = new SqliteSettingsStorage();
     _settings = _settingsStorage.LoadSettings();
     SettingsFolder = (_settingsStorage as SqliteSettingsStorage).RootSettingsFolder;
 }
コード例 #52
0
		/// <summary>
		/// Construct a settings group.
		/// </summary>
		/// <param name="storage">Storage for the group settings</param>
		public SettingsGroup( ISettingsStorage storage )
		{
			this.storage = storage;
		}
コード例 #53
0
ファイル: PluginLoader.cs プロジェクト: accandme/pocketcampus
 /// <summary>
 /// Creates a new instance of the <see cref="PluginLoader" /> class.
 /// </summary>
 public PluginLoader( ISettingsStorage settings )
 {
     _settings = settings;
     _cachedTypesKey = string.Format( CachedTypesKeyFormat, Assembly.GetExecutingAssembly().GetName().Version.ToString() );
 }
コード例 #54
0
 public SqlSProcPublishSettings(ISettingsStorage settingsStorage) {
     Load(settingsStorage);
 }
コード例 #55
0
ファイル: PublishSProcCommand.cs プロジェクト: Microsoft/RTVS
 public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) :
     this(appShell, pss, new FileSystem(), dacServicesProvider, settings) {
 }
コード例 #56
0
 public PublishOptionsDialogModelTest() {
     _coreShell = Substitute.For<ICoreShell>();
     _pss = Substitute.For<IProjectSystemServices>();
     _pcsp = Substitute.For<IProjectConfigurationSettingsProvider>();
     _storage = Substitute.For<ISettingsStorage>();
 }
コード例 #57
0
 public RToolsSettingsImplementation(ISettingsStorage settings, ICoreShell coreShell) {
     _settings = settings;
     _loggingPermissions = coreShell.Services.LoggingServices.Permissions;
     _workingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
 }
コード例 #58
0
 public PremiumHandler(IMediator mediator, ISettingsStorage storage) {
     _mediator = mediator;
     _storage = storage;
 }
コード例 #59
0
 public FirstStartHandler(ISettingsStorage settings)
 {
     _settings = settings;
 }
コード例 #60
0
        public void Setup()
        {
            _settingsStorage = new SettingsStorage();

            _settingsStorage.StoreData("Test1", "Key1");
        }