public Main() { _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); cachedBookmarks = Bookmarks.LoadAllBookmarks(); }
public Main() { _storage = new PluginJsonStorage <UriSettings>(); _uriSettings = _storage.Load(); _uriParser = new ExtendedUriParser(); _uriResolver = new UriResolver(); }
public Main() { _settingsStorage = new PluginJsonStorage <Settings>(); _settings = _settingsStorage.Load(); Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Preload programs cost", () => { _win32Storage = new BinaryStorage <Win32[]>("Win32"); _win32s = _win32Storage.TryLoad(new Win32[] { }); _uwpStorage = new BinaryStorage <UWP.Application[]>("UWP"); _uwps = _uwpStorage.TryLoad(new UWP.Application[] { }); }); Log.Info($"|Flow.Launcher.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>"); Log.Info($"|Flow.Launcher.Plugin.Program.Main|Number of preload uwps <{_uwps.Length}>"); var a = Task.Run(() => { if (IsStartupIndexProgramsRequired || !_win32s.Any()) { Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Win32Program index cost", IndexWin32Programs); } }); var b = Task.Run(() => { if (IsStartupIndexProgramsRequired || !_uwps.Any()) { Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Win32Program index cost", IndexUWPPrograms); } }); Task.WaitAll(a, b); _settings.LastIndexTime = DateTime.Today; }
public Main() { _settingsStorage = new PluginJsonStorage<Settings>(); _settings = _settingsStorage.Load(); _cacheStorage = new BinaryStorage<ProgramIndexCache>(); _cache = _cacheStorage.Load(); }
public Main() { _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); //TODO: Let the user select which browser's bookmarks are displayed var chromeBookmarks = new ChromeBookmarks().GetBookmarks().Distinct().ToList(); lock (_updateLock) { cachedBookmarks = chromeBookmarks; } Task.Run(() => { // firefox bookmarks is slow, since it nened open sqlite connection. // use lazy load var mozBookmarks = new FirefoxBookmarks().GetBookmarks(); var cached = mozBookmarks.Concat(cachedBookmarks).Distinct().ToList(); lock (_updateLock) { cachedBookmarks = cached; } }); }
public void Init(PluginInitContext context) { Context = context; _storage = new PluginJsonStorage <SwitcherooSettings>(); _settings = _storage.Load(); context.API.GlobalKeyboardEvent += API_GlobalKeyboardEvent; }
public Main() { _settingsStorage = new PluginJsonStorage <Settings>(); _settings = _settingsStorage.Load(); Stopwatch.Normal("|Microsoft.Plugin.Program.Main|Preload programs cost", () => { _win32Storage = new BinaryStorage <Programs.Win32[]>("Win32"); _win32s = _win32Storage.TryLoad(new Programs.Win32[] { }); _packageRepository.Load(); }); Log.Info($"|Microsoft.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>"); var a = Task.Run(() => { if (IsStartupIndexProgramsRequired || !_win32s.Any()) { Stopwatch.Normal("|Microsoft.Plugin.Program.Main|Win32Program index cost", IndexWin32Programs); } }); var b = Task.Run(() => { if (IsStartupIndexProgramsRequired || !_packageRepository.Any()) { Stopwatch.Normal("|Microsoft.Plugin.Program.Main|Win32Program index cost", _packageRepository.IndexPrograms); } }); Task.WaitAll(a, b); _settings.LastIndexTime = DateTime.Today; }
public Main() { _settingsStorage = new PluginJsonStorage <ProgramPluginSettings>(); Settings = _settingsStorage.Load(); // This helper class initializes the file system watchers based on the locations to watch _win32ProgramRepositoryHelper = new Win32ProgramFileSystemWatchers(); // Initialize the Win32ProgramRepository with the settings object _win32ProgramRepository = new Win32ProgramRepository(_win32ProgramRepositoryHelper.FileSystemWatchers.Cast <IFileSystemWatcherWrapper>().ToList(), new BinaryStorage <IList <Programs.Win32Program> >("Win32"), Settings, _win32ProgramRepositoryHelper.PathsToWatch); var a = Task.Run(() => { Stopwatch.Normal("|Microsoft.Plugin.Program.Main|Win32Program index cost", _win32ProgramRepository.IndexPrograms); }); var b = Task.Run(() => { Stopwatch.Normal("|Microsoft.Plugin.Program.Main|Win32Program index cost", _packageRepository.IndexPrograms); }); Task.WaitAll(a, b); Settings.LastIndexTime = DateTime.Today; }
public Main() { _settingsStorage = new PluginJsonStorage <Settings>(); _settings = _settingsStorage.Load(); _cacheStorage = new BinaryStorage <ProgramIndexCache>(); _cache = _cacheStorage.Load(); }
public void Init(PluginInitContext context) { // initialize the context of the plugin _context = context; _contextMenuLoader = new ContextMenuLoader(context); _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); }
public SettingsControl() { InitializeComponent(); storage = new PluginJsonStorage <Settings>(); settings = storage.Load(); apiKeyText.Text = settings.apiKey; }
public void Init(PluginInitContext context) { _context = context; _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); _debouncer = new Debouncer(_settings.Delay); LoadData(); }
// 网络请求 public JObject Request(string baseCode) { PluginJsonStorage <Settings> storage = new PluginJsonStorage <Settings>(); Settings settings = storage.Load(); var request = (HttpWebRequest)WebRequest.Create("https://v6.exchangerate-api.com/v6/" + settings.apiKey + "/latest/" + baseCode); var response = (HttpWebResponse)request.GetResponse(); var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd(); return(Str2Json(responseString)); }
public void Init(PluginInitContext context) { // initialize the context of the plugin _context = context; _contextMenuLoader = new ContextMenuLoader(context); _storage = new PluginJsonStorage <IndexerSettings>(); _settings = _storage.Load(); _context.API.ThemeChanged += OnThemeChanged; UpdateIconPath(_context.API.GetCurrentTheme()); }
public Main() { _settingsStorage = new PluginJsonStorage <Settings>(); _settings = _settingsStorage.Load(); Stopwatch.Normal("|Wox.Plugin.Program.Main|Preload programs cost", () => { _win32Storage = new BinaryStorage <Win32[]>("Win32"); _win32s = _win32Storage.TryLoad(new Win32[] { }); }); Log.Info($"|Wox.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>"); }
public Main() { _settingsStorage = new PluginJsonStorage <ProgramPluginSettings>(); Settings = _settingsStorage.Load(); // This helper class initializes the file system watchers based on the locations to watch _win32ProgramRepositoryHelper = new Win32ProgramFileSystemWatchers(); // Initialize the Win32ProgramRepository with the settings object _win32ProgramRepository = new Win32ProgramRepository(_win32ProgramRepositoryHelper.FileSystemWatchers.Cast <IFileSystemWatcherWrapper>().ToList(), new BinaryStorage <IList <Programs.Win32Program> >("Win32"), Settings, _win32ProgramRepositoryHelper.PathsToWatch); }
static Utilities() { Storage = new PluginJsonStorage <Settings>(); FileSystem = new FileSystem(); Path = FileSystem.Path; File = FileSystem.File; Directory = FileSystem.Directory; PluginDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); Settings = Storage.Load(); }
public void Init(PluginInitContext context) { Context = context; _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; var bundledImagesDirectory = Path.Combine(pluginDirectory, Images); Helper.ValidateDataDirectory(bundledImagesDirectory, ImagesDirectory); }
public Main() { _settingsStorage = new PluginJsonStorage <Settings>(); _settings = _settingsStorage.Load(); Stopwatch.Debug("Preload programs", () => { _cacheStorage = new BinaryStorage <ProgramIndexCache>(); _cache = _cacheStorage.Load(); _win32s = _cache.Programs; }); Log.Info($"Preload {_win32s.Length} programs from cache"); Stopwatch.Debug("Program Index", IndexPrograms); }
public Main() { _settingsStorage = new PluginJsonStorage<Settings>(); _settings = _settingsStorage.Load(); Stopwatch.Debug("Preload programs", () => { _cacheStorage = new BinaryStorage<ProgramIndexCache>(); _cache = _cacheStorage.Load(); _win32s = _cache.Programs; }); Log.Info($"Preload {_win32s.Length} programs from cache"); Stopwatch.Debug("Program Index", IndexPrograms); }
public void Init(PluginInitContext context) { _context = context; _storage = new PluginJsonStorage<Settings>(); _settings = _storage.Load(); var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; const string sdk = "EverythingSDK"; var bundledSDKDirectory = Path.Combine(pluginDirectory, sdk, CpuType()); var sdkDirectory = Path.Combine(_storage.DirectoryPath, sdk, CpuType()); Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory); var sdkPath = Path.Combine(sdkDirectory, DLL); LoadLibrary(sdkPath); }
public void Init(PluginInitContext context) { var s = Utilities.GetInstalledPath(); if (string.IsNullOrEmpty(s)) { Task.Run(async delegate { context.API.ShowMsg(context.API.GetTranslation("flowlauncher_plugin_everything_installing_title"), context.API.GetTranslation("flowlauncher_plugin_everything_installing_subtitle"), "", useMainWindowAsOwner: false); await DroplexPackage.Drop(App.Everything1_3_4_686).ConfigureAwait(false); context.API.ShowMsg(context.API.GetTranslation("flowlauncher_plugin_everything_installing_title"), context.API.GetTranslation("flowlauncher_plugin_everything_installationsuccess_subtitle"), "", useMainWindowAsOwner: false); SharedCommands.FilesFolders.OpenPath(installationFilePath); }).ContinueWith(t => { Log.Exception("Main", $"Failed to install Everything service", t.Exception.InnerException, "DroplexPackage.Drop"); MessageBox.Show(context.API.GetTranslation("flowlauncher_plugin_everything_installationfailed_subtitle"), context.API.GetTranslation("flowlauncher_plugin_everything_installing_title")); }, TaskContinuationOptions.OnlyOnFaulted); } else { installationFilePath = s; } _context = context; _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); if (_settings.MaxSearchCount <= 0) { _settings.MaxSearchCount = Settings.DefaultMaxSearchCount; } var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; const string sdk = "EverythingSDK"; var bundledSDKDirectory = Path.Combine(pluginDirectory, sdk, CpuType()); var sdkDirectory = Path.Combine(_storage.DirectoryPath, sdk, CpuType()); Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory); var sdkPath = Path.Combine(sdkDirectory, DLL); _api.Load(sdkPath); }
public async Task InitAsync(PluginInitContext context) { _context = context; await Task.Run(() => { _settings = _settingsStorage.Load(); Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Preload programs cost", () => { _win32Storage = new BinaryStorage <Win32[]>("Win32"); _win32s = _win32Storage.TryLoad(new Win32[] { }); _uwpStorage = new BinaryStorage <UWP.Application[]>("UWP"); _uwps = _uwpStorage.TryLoad(new UWP.Application[] { }); }); Log.Info($"|Flow.Launcher.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>"); Log.Info($"|Flow.Launcher.Plugin.Program.Main|Number of preload uwps <{_uwps.Length}>"); }); bool indexedWinApps = false; bool indexedUWPApps = false; var a = Task.Run(() => { if (IsStartupIndexProgramsRequired || !_win32s.Any()) { Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Win32Program index cost", IndexWin32Programs); indexedWinApps = true; } }); var b = Task.Run(() => { if (IsStartupIndexProgramsRequired || !_uwps.Any()) { Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Win32Program index cost", IndexUwpPrograms); indexedUWPApps = true; } }); await Task.WhenAll(a, b); if (indexedWinApps && indexedUWPApps) { _settings.LastIndexTime = DateTime.Today; } }
public void Init(PluginInitContext context) { _context = context; _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; const string sdk = "EverythingSDK"; var bundledSDKDirectory = Path.Combine(pluginDirectory, sdk, CpuType()); var sdkDirectory = Path.Combine(_storage.DirectoryPath, sdk, CpuType()); Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory); var sdkPath = Path.Combine(sdkDirectory, DLL); LoadLibrary(sdkPath); }
public void Init(PluginInitContext context) { _context = context; _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); if (_settings.MaxSearchCount <= 0) { _settings.MaxSearchCount = Settings.DefaultMaxSearchCount; } var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; const string sdk = "EverythingSDK"; var sdkDirectory = Path.Combine(pluginDirectory, sdk, CpuType()); var sdkPath = Path.Combine(sdkDirectory, DLL); Logger.WoxInfo("Everything", $"sdk path {sdkPath}"); Constant.EverythingSDKPath = sdkPath; _api.Load(sdkPath); }
public Main() { _settingsStorage = new PluginJsonStorage <Settings>(); _settings = _settingsStorage.Load(); Stopwatch.Normal("|Wox.Plugin.Program.Main|Preload programs cost", () => { _win32Storage = new BinaryStorage <Win32[]>("Win32"); _win32s = _win32Storage.TryLoad(new Win32[] { }); _uwpStorage = new BinaryStorage <UWP.Application[]>("UWP"); _uwps = _uwpStorage.TryLoad(new UWP.Application[] { }); }); Log.Info($"|Wox.Plugin.Program.Main|Number of preload win32 programs <{_win32s.Length}>"); Log.Info($"|Wox.Plugin.Program.Main|Number of preload uwps <{_uwps.Length}>"); Task.Run(() => { Stopwatch.Normal("|Wox.Plugin.Program.Main|Program index cost", IndexPrograms); }); }
public Main() { _settingsStorage = new PluginJsonStorage<Settings>(); _settings = _settingsStorage.Load(); Stopwatch.Normal("Preload programs", () => { _win32Storage = new BinaryStorage<Win32[]>("Win32Cache"); _win32s = _win32Storage.TryLoad(new Win32[] { }); _uwpStorage = new BinaryStorage<UWP.Application[]>("UWPCache"); _uwps = _uwpStorage.TryLoad(new UWP.Application[] { }); }); Log.Info($"Preload {_win32s.Length} win32 programs from cache"); Log.Info($"Preload {_uwps.Length} uwps from cache"); Task.Run(() => { Stopwatch.Normal("Program Index", IndexPrograms); }); }
public void Init(PluginInitContext context) { _context = context; _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); if (_settings.MaxSearchCount <= 0) { _settings.MaxSearchCount = Settings.DefaultMaxSearchCount; } var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; const string sdk = "EverythingSDK"; var bundledSDKDirectory = Path.Combine(pluginDirectory, sdk, CpuType()); var sdkDirectory = Path.Combine(_storage.DirectoryPath, sdk, CpuType()); Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory); var sdkPath = Path.Combine(sdkDirectory, DLL); Constant.EverythingSDKPath = sdkPath; _api.Load(sdkPath); }
public void Init(PluginInitContext context) { Log.Info($"|Wox.Plugin.MigemoSearch|Init started."); _context = context; _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; const string sdk = "EverythingSDK"; var bundledSDKDirectory = Path.Combine(pluginDirectory, sdk, CpuType()); var sdkDirectory = Path.Combine(_storage.DirectoryPath, sdk, CpuType()); Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory); var sdkPath = Path.Combine(sdkDirectory, EVERYTHING_DLL); Constant.EverythingSDKPath = sdkPath; LoadLibrary(sdkPath); // Migemo pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; const string migemoSdk = "MigemoSDK"; bundledSDKDirectory = Path.Combine(pluginDirectory, migemoSdk, CpuType()); sdkDirectory = Path.Combine(_storage.DirectoryPath, migemoSdk, CpuType()); Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory); sdkPath = Path.Combine(sdkDirectory, "migemo.dll"); Log.Info($"|Wox.Plugin.MigemoSearch|pluginDirectory=<{pluginDirectory}>, bundledSDKDirectory=<{bundledSDKDirectory}>, sdkDirectory=<{sdkDirectory}>, sdkPath=<{sdkPath}>"); LoadLibrary(sdkPath); bundledSDKDirectory = Path.Combine(pluginDirectory, migemoSdk, "dict/cp932"); sdkDirectory = Path.Combine(_storage.DirectoryPath, migemoSdk, "dict/cp932"); Helper.ValidateDataDirectory(bundledSDKDirectory, sdkDirectory); Log.Info($"|Wox.Plugin.MigemoSearch|dict=<{Path.Combine(_storage.DirectoryPath, migemoSdk, "dict/cp932/migemo-dict")}>"); _migemo_api = new Migemo(Path.Combine(_storage.DirectoryPath, migemoSdk, "dict/cp932/migemo-dict")); //_migemo_api.OperatorNewLine = @"\s*"; Log.Info($"|Wox.Plugin.MigemoSearch|Init complated."); }
public Main() { _settingsStorage = new PluginJsonStorage <Settings>(); _settings = _settingsStorage.Load(); // This helper class initializes the file system watchers based on the locations to watch _win32ProgramRepositoryHelper = new Win32ProgramFileSystemWatchers(); // Initialize the Win32ProgramRepository with the settings object _win32ProgramRepository = new Win32ProgramRepository(_win32ProgramRepositoryHelper._fileSystemWatchers.Cast <IFileSystemWatcherWrapper>().ToList(), new BinaryStorage <IList <Programs.Win32> >("Win32"), _settings, _win32ProgramRepositoryHelper._pathsToWatch); Stopwatch.Normal("|Microsoft.Plugin.Program.Main|Preload programs cost", () => { _win32ProgramRepository.Load(); _packageRepository.Load(); }); Log.Info($"|Microsoft.Plugin.Program.Main|Number of preload win32 programs <{_win32ProgramRepository.Count()}>"); var a = Task.Run(() => { if (IsStartupIndexProgramsRequired || !_win32ProgramRepository.Any()) { Stopwatch.Normal("|Microsoft.Plugin.Program.Main|Win32Program index cost", _win32ProgramRepository.IndexPrograms); } }); var b = Task.Run(() => { if (IsStartupIndexProgramsRequired || !_packageRepository.Any()) { Stopwatch.Normal("|Microsoft.Plugin.Program.Main|Win32Program index cost", _packageRepository.IndexPrograms); } }); Task.WaitAll(a, b); _settings.LastIndexTime = DateTime.Today; }
public CMD() { _storage = new PluginJsonStorage <Settings>(); _settings = _storage.Load(); }
public Main() { _storage = new PluginJsonStorage <ShellPluginSettings>(); _settings = _storage.Load(); }
public void loadSettings() { _settingsStorage = new PluginJsonStorage <Settings>(); _settings = _settingsStorage.Load(); }
public SettingsViewModel() { _storage = new PluginJsonStorage <Settings>(); Settings = _storage.Load(); }
public CMD() { _storage = new PluginJsonStorage<Settings>(); _settings = _storage.Load(); }
public Main() { _storage = new PluginJsonStorage<Settings>(); _settings = _storage.Load(); InitialDriverList(); }