public MainViewModel(Settings settings) { _saved = false; _queryTextBeforeLeaveResults = ""; _queryText = ""; _lastQuery = new Query(); _settings = settings; _historyItemsStorage = new JsonStrorage <History>(); _userSelectedRecordStorage = new JsonStrorage <UserSelectedRecord>(); _topMostRecordStorage = new JsonStrorage <TopMostRecord>(); _history = _historyItemsStorage.Load(); _userSelectedRecord = _userSelectedRecordStorage.Load(); _topMostRecord = _topMostRecordStorage.Load(); ContextMenu = new ResultsViewModel(_settings); Results = new ResultsViewModel(_settings); History = new ResultsViewModel(_settings); _selectedResults = Results; InitializeKeyCommands(); RegisterResultsUpdatedEvent(); SetHotkey(_settings.Hotkey, OnHotkey); SetCustomPluginHotkey(); }
public MainViewModel(Settings settings) { _saved = false; _queryTextBeforeLoadContextMenu = ""; _queryText = ""; _lastQuery = new Query(); _settings = settings; // happlebao todo temp fix for instance code logic HttpProxy.Instance.Settings = _settings; InternationalizationManager.Instance.Settings = _settings; InternationalizationManager.Instance.ChangeLanguage(_settings.Language); ThemeManager.Instance.Settings = _settings; _queryHistoryStorage = new JsonStrorage <QueryHistory>(); _userSelectedRecordStorage = new JsonStrorage <UserSelectedRecord>(); _topMostRecordStorage = new JsonStrorage <TopMostRecord>(); _queryHistory = _queryHistoryStorage.Load(); _userSelectedRecord = _userSelectedRecordStorage.Load(); _topMostRecord = _topMostRecordStorage.Load(); InitializeResultListBox(); InitializeContextMenu(); InitializeKeyCommands(); RegisterResultsUpdatedEvent(); SetHotkey(_settings.Hotkey, OnHotkey); SetCustomPluginHotkey(); }
public MainViewModel(Settings settings) { _saved = false; _queryTextBeforeLoadContextMenu = ""; _queryText = ""; _lastQuery = new Query(); _settings = settings; // happlebao todo temp fix for instance code logic HttpProxy.Instance.Settings = _settings; InternationalizationManager.Instance.Settings = _settings; InternationalizationManager.Instance.ChangeLanguage(_settings.Language); ThemeManager.Instance.Settings = _settings; _queryHistoryStorage = new JsonStrorage<QueryHistory>(); _userSelectedRecordStorage = new JsonStrorage<UserSelectedRecord>(); _topMostRecordStorage = new JsonStrorage<TopMostRecord>(); _queryHistory = _queryHistoryStorage.Load(); _userSelectedRecord = _userSelectedRecordStorage.Load(); _topMostRecord = _topMostRecordStorage.Load(); InitializeResultListBox(); InitializeContextMenu(); InitializeKeyCommands(); RegisterResultsUpdatedEvent(); SetHotkey(_settings.Hotkey, OnHotkey); SetCustomPluginHotkey(); }
private void OnStartup(object sender, StartupEventArgs e) { Stopwatch.Debug("Startup Time", () => { RegisterDispatcherUnhandledException(); ImageLoader.PreloadImages(); var storage = new JsonStrorage <Settings>(); _settings = storage.Load(); PluginManager.LoadPlugins(_settings.PluginSettings); var vm = new MainViewModel(_settings, storage); var window = new MainWindow(_settings, vm); API = new PublicAPIInstance(_settings, vm); PluginManager.InitializePlugins(API); Current.MainWindow = window; Current.MainWindow.Title = Infrastructure.Constant.Wox; RegisterExitEvents(); AutoStartup(); AutoUpdates(); window.Show(); }); }
public MainViewModel() { _queryTextBeforeLoadContextMenu = ""; _queryText = ""; _lastQuery = new Query(); _settingsStorage = new JsonStrorage <Settings>(); _settings = _settingsStorage.Load(); // happlebao todo temp fix for instance code logic HttpProxy.Instance.Settings = _settings; UpdaterManager.Instance.Settings = _settings; InternationalizationManager.Instance.Settings = _settings; ThemeManager.Instance.Settings = _settings; _queryHistoryStorage = new JsonStrorage <QueryHistory>(); _userSelectedRecordStorage = new JsonStrorage <UserSelectedRecord>(); _topMostRecordStorage = new JsonStrorage <TopMostRecord>(); _queryHistory = _queryHistoryStorage.Load(); _userSelectedRecord = _userSelectedRecordStorage.Load(); _topMostRecord = _topMostRecordStorage.Load(); InitializeResultListBox(); InitializeContextMenu(); InitializeKeyCommands(); }
public MainViewModel(Settings settings) { _saved = false; _queryTextBeforeLeaveResults = ""; _queryText = ""; _lastQuery = new Query(); _settings = settings; _historyItemsStorage = new JsonStrorage<History>(); _userSelectedRecordStorage = new JsonStrorage<UserSelectedRecord>(); _topMostRecordStorage = new JsonStrorage<TopMostRecord>(); _history = _historyItemsStorage.Load(); _userSelectedRecord = _userSelectedRecordStorage.Load(); _topMostRecord = _topMostRecordStorage.Load(); ContextMenu = new ResultsViewModel(_settings); Results = new ResultsViewModel(_settings); History = new ResultsViewModel(_settings); _selectedResults = Results; InitializeKeyCommands(); RegisterResultsUpdatedEvent(); SetHotkey(_settings.Hotkey, OnHotkey); SetCustomPluginHotkey(); }
public SettingWindowViewModel() { _storage = new JsonStrorage <Settings>(); Settings = _storage.Load(); Settings.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(Settings.ActivateTimes)) { OnPropertyChanged(nameof(ActivatedTimes)); } }; }
public SettingWindowViewModel() { _storage = new JsonStrorage<Settings>(); Settings = _storage.Load(); Settings.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(Settings.ActivateTimes)) { OnPropertyChanged(nameof(ActivatedTimes)); } }; // happlebao todo temp fix for instance code logic InternationalizationManager.Instance.Settings = Settings; InternationalizationManager.Instance.ChangeLanguage(Settings.Language); ThemeManager.Instance.Settings = Settings; Http.Proxy = Settings.Proxy; }
public SettingWindowViewModel() { _storage = new JsonStrorage <Settings>(); Settings = _storage.Load(); Settings.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(Settings.ActivateTimes)) { OnPropertyChanged(nameof(ActivatedTimes)); } }; // happlebao todo temp fix for instance code logic InternationalizationManager.Instance.Settings = Settings; InternationalizationManager.Instance.ChangeLanguage(Settings.Language); ThemeManager.Instance.Settings = Settings; Http.Proxy = Settings.Proxy; }
public SettingsViewModel() { _storage = new PluginJsonStorage<Settings>(); Settings = _storage.Load(); }
public SettingWindowViewModel() { _storage = new JsonStrorage <Settings>(); Settings = _storage.Load(); }
public SettingsViewModel() { _storage = new PluginJsonStorage <Settings>(); Settings = _storage.Load(); }