public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IFileSystem fs, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) { _appShell = appShell; _pss = pss; _fs = fs; _dacServicesProvider = dacServicesProvider; _settings = settings; }
/// <summary> /// Dispose of this group by disposing of it's storage implementation /// </summary> public void Dispose() { if ( storage != null ) { storage.Dispose(); storage = null; } }
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); }
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; }
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); }
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); }
public PublishSProcOptionsCommand(IApplicationShell appShell, IProjectSystemServices pss, IProjectConfigurationSettingsProvider pcsp, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) { _appShell = appShell; _pss = pss; _pcsp = pcsp; _dacServicesProvider = dacServicesProvider; _settings = settings; }
public MainViewModel(IMissionSourceFactory factory, ISettingsStorage settingsStorage) { _synchronizationContext = SynchronizationContext.Current; _missionSourceFactory = factory; _settingsStorage = settingsStorage; SetupCommands(); RetrieveSavedSettings(); }
public UserStorage( ILogger logger, ISettingsStorage storage, UserSettings userSettings) { _logger = logger; _storage = storage; _userSettings = userSettings; }
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; }
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; }
public static void SavePropertyValues(this ISettingsStorage settings, object o) { var dict = o.GetPropertyValueDictionary(); foreach (var kvp in dict) { settings.SetSetting(kvp.Key, kvp.Value); } }
public SenderFiles( IWorkFlowProducerConsumer consumer, ISettingsStorage settings, IConsoleService console, Proxy proxy) : base(consumer, settings, console) { _proxy = proxy.CreateRemoteProxy <IRemoteInteraction>(); _console.AddEvent($"{nameof(SenderFiles)} ready."); }
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)); }
public SettingsForm(ISettingsStorage settingsStorage) { InitializeComponent(); this.settingsStorage = settingsStorage; String savedPath = settingsStorage.GetValue(SettingsKeys.OutputDirectoryKey); if (savedPath != null) { pathTextBox.Text = savedPath; } }
/// <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); }
public PageLogin() { InitializeComponent(); if (!this.DesignMode) { store = new PortableStorage();//保存在本地计算机 settings = new SettingsProvider(store); } }
/// <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); }
public void ReloadSettings() { if (_settingsStorage != null) { _settingsStorage.Dispose(); _settingsStorage = null; } _settingsStorage = new SqliteSettingsStorage(); _settings = _settingsStorage.LoadSettings(); }
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); }
public void ReloadSettings() { if (_settingsStorage != null) { _settingsStorage.Dispose(); _settingsStorage = null; } _settingsStorage = new SqliteSettingsStorage(); _settings = _settingsStorage.LoadSettings(); SettingsFolder = (_settingsStorage as SqliteSettingsStorage).RootSettingsFolder; }
public ApplicationSettings(ISettingsStorage storage) { _storage = storage; if (!_storage.TryGetValue <ApplicationSettings>(StorageKey, out var oldSettings)) { oldSettings = Default; } CreateMapper().Map(oldSettings, this); }
//--------------------------------------------------------------------- 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); }
public PageReport() { InitializeComponent(); if (!this.DesignMode) { // PortableStorage: 在运行程序目录创建一个setting的文件记录参数数据 store = new PortableStorage(); settings = new SettingsProvider(store); } }
public ActGridControl( IConsoleService console, ISettingsStorage settings) { _console = console; _settings = settings; InitializeComponent(); //_fastAccess = new Dictionary<int, Guid>(); CreateFields <FlatAct>(); }
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; }
public JsonReadFiles( ISettingsStorage settings, IConsoleService console, IWorkFlowProducerConsumer consumer, DbContext context, IUnityContainer container) : base(consumer, settings, console) { _context = (ModelContext)context; _console.AddEvent($"{nameof(JsonReadFiles)} ready."); }
public PageEmail() { InitializeComponent(); if (!this.DesignMode) { //DatabaseStorage:在数据库里面,以指定用户标识保存参数数据 string creator = Portal.gc.LoginUserInfo.Name; store = new DatabaseStorage(creator); settings = new SettingsProvider(store); } }
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)); }
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."); }
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"))); }
public ApplicationSettings(ISettingsStorage settingsStorage) { _settingsStorage = settingsStorage; if (Servers == null) { Servers = new Dictionary <string, Server>(); } if (UserNames == null) { UserNames = new Dictionary <string, string>(); } }
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); }
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; } }
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 } } }
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(); }
protected WorkFlowBase( ISettingsStorage settings, IConsoleService console) { if (settings == null) { new ArgumentNullException(nameof(settings)); } _settings = settings; if (console == null) { new ArgumentNullException(nameof(console)); } _console = console; }
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); }
public static bool GetValidationEnabled(ISettingsStorage storage) { return storage.GetBoolean(ValidationEnabledKey, true); }
public MainViewModel(ISettingsStorage settings, IDarumaApplicationService darumaService) { _settings = settings; _darumaService = darumaService; }
public void PrepareReloadSettings() { if (_settingsStorage != null) { _settingsStorage.Dispose(); _settingsStorage = null; } }
public LegacySettingsConverter( ISettingsStorage legacy, ISettingsStorage current ) : base(current) { this.legacy = legacy; this.current = current; }
public TokenRefresher(IOauthConnect connect, IMediator mediator, ISettingsStorage storage) { _connect = connect; _storage = storage; _premiumRefresher = new PremiumHandler(mediator, storage); }
public void Initialize(ISettingsStorage settingsStorage) { this.settingsStorage = settingsStorage; }
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; }
/// <summary> /// Construct a settings group. /// </summary> /// <param name="storage">Storage for the group settings</param> public SettingsGroup( ISettingsStorage storage ) { this.storage = storage; }
/// <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() ); }
public SqlSProcPublishSettings(ISettingsStorage settingsStorage) { Load(settingsStorage); }
public PublishSProcCommand(IApplicationShell appShell, IProjectSystemServices pss, IDacPackageServicesProvider dacServicesProvider, ISettingsStorage settings) : this(appShell, pss, new FileSystem(), dacServicesProvider, settings) { }
public PublishOptionsDialogModelTest() { _coreShell = Substitute.For<ICoreShell>(); _pss = Substitute.For<IProjectSystemServices>(); _pcsp = Substitute.For<IProjectConfigurationSettingsProvider>(); _storage = Substitute.For<ISettingsStorage>(); }
public RToolsSettingsImplementation(ISettingsStorage settings, ICoreShell coreShell) { _settings = settings; _loggingPermissions = coreShell.Services.LoggingServices.Permissions; _workingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); }
public PremiumHandler(IMediator mediator, ISettingsStorage storage) { _mediator = mediator; _storage = storage; }
public FirstStartHandler(ISettingsStorage settings) { _settings = settings; }
public void Setup() { _settingsStorage = new SettingsStorage(); _settingsStorage.StoreData("Test1", "Key1"); }