public SettingsControl(PluginInitContext context, SettingsViewModel viewModel) { InitializeComponent(); _context = context; _settings = viewModel.Settings; DataContext = viewModel; }
public ProgramSetting(PluginInitContext context, Settings settings) { this.context = context; InitializeComponent(); Loaded += Setting_Loaded; _settings = settings; }
protected override void InitInternal(PluginInitContext context) { this.context = context; if (UserSettingStorage.Instance.WebSearches == null) UserSettingStorage.Instance.WebSearches = UserSettingStorage.Instance.LoadDefaultWebSearches(); }
public void Init(PluginInitContext context) { var dir = new DirectoryInfo(@"Plugins\Wox.Plugin.ServerCodes\Codes"); // папка с файлами // получаем полный путь к файлу и потом вычищаем ненужное, оставляем только имя файла. _files = dir.GetFiles("*.txt").Select(file => Path.GetFileNameWithoutExtension(file.FullName)).ToList(); }
public WebSearchSetting(WebSearchesSetting settingWidow) { _plguin = settingWidow.Plugin; _context = settingWidow.Context; _settingWindow = settingWidow; InitializeComponent(); }
public ProgramSuffixes(PluginInitContext context) { this.context = context; InitializeComponent(); tbSuffixes.Text = ProgramStorage.Instance.ProgramSuffixes; }
public ProgramSuffixes(PluginInitContext context, Settings settings) { this.context = context; InitializeComponent(); _settings = settings; tbSuffixes.Text = string.Join(ProgramSource.SuffixSeperator.ToString(), _settings.ProgramSuffixes); }
protected override void InitInternal(PluginInitContext context) { availableResults.Add(new Result { Title = "Shutdown", SubTitle = "Shutdown Computer", Score = 100, IcoPath = "Images\\exit.png", Action = (c) => Process.Start("shutdown","/s /t 0") }); availableResults.Add(new Result { Title = "Log off", SubTitle = "Log off current user", Score = 20, IcoPath = "Images\\logoff.png", Action = (c) => ExitWindowsEx(EWX_LOGOFF, 0) }); availableResults.Add(new Result { Title = "Lock", SubTitle = "Lock this computer", Score = 20, IcoPath = "Images\\lock.png", Action = (c) => LockWorkStation() }); availableResults.Add(new Result { Title = "Exit", SubTitle = "Close this app", Score = 110, IcoPath = "Images\\app.png", Action = (c) => context.CloseApp() }); }
public void Init(PluginInitContext context) { this.context = context; controlPanelItems = ControlPanelList.Create(48); iconFolder = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, @"Images\ControlPanelIcons\"); fileType = ".bmp"; if (!Directory.Exists(iconFolder)) { Directory.CreateDirectory(iconFolder); } foreach (ControlPanelItem item in controlPanelItems) { if (!File.Exists(iconFolder + item.GUID + fileType) && item.Icon != null) { item.Icon.ToBitmap().Save(iconFolder + item.GUID + fileType); } } Task.Run(() => { var characters = controlPanelItems.Select(i => i.LocalizedString) .Concat(controlPanelItems.Select(i => i.InfoTip)); Parallel.ForEach(characters, c => { if (!string.IsNullOrWhiteSpace(c) && Alphabet.ContainsChinese(c)) { Alphabet.PinyinComination(c); } }); }); }
public void Init(PluginInitContext context) { this.Context = context; if (WebSearchStorage.Instance.WebSearches == null) WebSearchStorage.Instance.WebSearches = WebSearchStorage.Instance.LoadDefaultWebSearches(); }
public WebSearchesSetting(PluginInitContext context) { this.context = context; InitializeComponent(); Loaded += Setting_Loaded; }
public void Init( PluginInitContext context ) { if ( !SimpleIoc.Default.IsRegistered<IMessageService>() ) { SimpleIoc.Default.Register<IMessageService>( () => new MessageService() ); } initContext = context; }
public JrnlService(SettingElements settings, PluginInitContext context) { if (settings == null) throw new ArgumentNullException("settings", "settings is null."); if (context == null) throw new ArgumentNullException("context", "context is null."); _settings = settings; }
public void Init(PluginInitContext context) { this.context = context; PluginDirectory = context.CurrentPluginMetadata.PluginDirectory; weibo = new Weibo(); keepLoginTimer = new System.Threading.Timer(new TimerCallback(this.KeepLoginCallBack), null, Timeout.Infinite, Timeout.Infinite); }
public void Init( PluginInitContext context ) { if ( !SimpleIoc.Default.IsRegistered<IMessageService>() ) { SimpleIoc.Default.Register<IMessageService>( () => new MessageService() ); } initContext = context; commands = RunnerConfiguration.GetCommands(); }
protected override void InitInternal(PluginInitContext context) { this.context = context; if (UserSettingStorage.Instance.FolderLinks == null) { UserSettingStorage.Instance.FolderLinks = new List<FolderLink>(); UserSettingStorage.Instance.Save(); } }
protected override void InitInternal(PluginInitContext context) { indexDirectory.Add(Environment.GetFolderPath(Environment.SpecialFolder.Programs)); StringBuilder commonStartMenuPath = new StringBuilder(560); SHGetSpecialFolderPath(IntPtr.Zero, commonStartMenuPath, CSIDL_COMMON_PROGRAMS, false); indexDirectory.Add(commonStartMenuPath.ToString()); GetAppFromStartMenu(); }
public void Init(PluginInitContext context) { if (context == null) throw new ArgumentNullException("context", "context is null."); _context = context; _settings = JsonConvert.DeserializeObject<SettingElements>( File.ReadAllText(Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "setting.json"))); CustomResult.DefaultIcoPath = context.CurrentPluginMetadata.IcoPath; }
public void Init(PluginInitContext context) { this.context = context; this.context.API.ResultItemDropEvent += API_ResultItemDropEvent; Stopwatch.Debug("Preload programs", () => { programs = ProgramCacheStorage.Instance.Programs; }); Log.Info($"Preload {programs.Count} programs from cache"); Stopwatch.Debug("Program Index", IndexPrograms); }
protected override void InitInternal(PluginInitContext context) { this.context = context; this.context.API.BackKeyDownEvent += ApiBackKeyDownEvent; InitialDriverList(); if (UserSettingStorage.Instance.FolderLinks == null) { UserSettingStorage.Instance.FolderLinks = new List<FolderLink>(); UserSettingStorage.Instance.Save(); } }
public void Init(PluginInitContext context) { this.context = context; ContextMenuStorage.Instance.API = context.API; LoadLibrary(Path.Combine( Path.Combine(context.CurrentPluginMetadata.PluginDirectory, (IntPtr.Size == 4) ? "x86" : "x64"), "Everything.dll" )); StartEverything(); }
public void Init(PluginInitContext context) { this.context = context; this.context.API.BackKeyDownEvent += ApiBackKeyDownEvent; this.context.API.ResultItemDropEvent += API_ResultItemDropEvent; InitialDriverList(); if (FolderStorage.Instance.FolderLinks == null) { FolderStorage.Instance.FolderLinks = new List<FolderLink>(); FolderStorage.Instance.Save(); } }
public static ISuggestionSource GetSuggestionSource(string name,PluginInitContext context) { switch (name.ToLower()) { case "google": return new Google(context.Proxy); case "baidu": return new Baidu(context.Proxy); default: return null; } }
public void Init(PluginInitContext context) { _context = context; // initialize data, passing it the plugin directory Task.Run(() => _api = new SpotifyApi(_context.CurrentPluginMetadata.PluginDirectory)); _terms.Add("artist", SearchArtist); _terms.Add("album", SearchAlbum); _terms.Add("track", SearchTrack); _terms.Add("next", PlayNext); _terms.Add("pause", Pause); _terms.Add("play", Play); _terms.Add("mute", ToggleMute); }
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) { this.context = context; this.context.API.BackKeyDownEvent += ApiBackKeyDownEvent; if (driveNames == null) { driveNames = DriveInfo.GetDrives().Select(d => d.Name.ToLower()).ToList(); } if (FolderStorage.Instance.FolderLinks == null) { FolderStorage.Instance.FolderLinks = new List<FolderLink>(); FolderStorage.Instance.Save(); } }
public void Init(PluginInitContext context) { this.context = context; // Cache all bookmarks var chromeBookmarks = new ChromeBookmarks(); var mozBookmarks = new FirefoxBookmarks(); //TODO: Let the user select which browser's bookmarks are displayed // Add Firefox bookmarks cachedBookmarks.AddRange(mozBookmarks.GetBookmarks()); // Add Chrome bookmarks cachedBookmarks.AddRange(chromeBookmarks.GetBookmarks()); cachedBookmarks = cachedBookmarks.Distinct().ToList(); }
// инициализация public void Init(PluginInitContext context) { // получение ссылки RSS var line = File.ReadAllLines(Directory.GetCurrentDirectory() + @"\Plugins\Wox.Plugin.Raindrop\url.txt").First(); if (line != null) { _url = line; } else { return; } // скачиваем rss файл new WebClient().DownloadFile(_url, _filename); }
public void Init(PluginInitContext context) { //todo:move to common place var otherCompanyDlls = new DirectoryInfo(context.PluginMetadata.PluginDirecotry).GetFiles("*.dll"); AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => { var dll = otherCompanyDlls.FirstOrDefault(fi => { try { Assembly assembly = Assembly.LoadFile(fi.FullName); return assembly.FullName == args.Name; } catch { return false; } }); if (dll == null) { return null; } return Assembly.LoadFile(dll.FullName); }; docsetBasePath = context.PluginMetadata.PluginDirecotry + @"Docset"; if (!Directory.Exists(docsetBasePath)) Directory.CreateDirectory(docsetBasePath); foreach (string path in Directory.GetDirectories(docsetBasePath)) { string name = path.Substring(path.LastIndexOf('\\') + 1); string dbPath = path + @"\Contents\Resources\docSet.dsidx"; string dbType = CheckTableExists("searchIndex", dbPath) ? "DASH" : "ZDASH"; docs.Add(new Doc { Name = name, DBPath = dbPath, DBType = dbType, IconPath = TryGetIcon(name, path) }); } }
public SettingsForm(PluginInitContext context, SettingElements settings, SettingService service) { if (service == null) throw new ArgumentNullException("service", "service is null."); if (context == null) throw new ArgumentNullException("context", "context is null."); if (settings == null) throw new ArgumentNullException("settings", "settings is null."); _settings = settings; _service = service; _context = context; InitializeComponent(); _settings.PropertyChanged += (sender, e) => _service.SaveSettings(context, settings); DataContext = _settings; }
public void Init(PluginInitContext context) { this._context = context; _context.API.ThemeChanged += OnThemeChanged; UpdateIconPath(_context.API.GetCurrentTheme()); }
public void Init(PluginInitContext context) { Client = new WebClient(); }
public void Init(PluginInitContext context) { _context = context; PrepareFileCache(); }
public void Init(PluginInitContext context) { this.context = context; ClipboardMonitor.OnClipboardChange += ClipboardMonitor_OnClipboardChange; ClipboardMonitor.Start(); }
public ContextMenuLoader(PluginInitContext context) { _context = context; }
public void Init(PluginInitContext context) { }
public DirectoryInfoSearch(PluginInitContext context) { resultManager = new ResultManager(context); }
public ContextMenu(PluginInitContext context, Settings settings) { Context = context; Settings = settings; }
public AlarmDeleteCommand(PluginInitContext context, CommandHandlerBase parent) : base(context, parent) { }
public void Init(PluginInitContext context) { this.context = context; _settings = context.API.LoadSettingJsonStorage <Settings>(); context.API.RegisterGlobalKeyboardCallback(API_GlobalKeyboardEvent); }
public void Init(PluginInitContext context) { _context = context; _settings = context.API.LoadSettingJsonStorage <Settings>(); SortOptionTranlationHelper.API = context.API; if (_settings.MaxSearchCount <= 0) { _settings.MaxSearchCount = Settings.DefaultMaxSearchCount; } if (!_settings.EverythingInstalledPath.FileExists()) { var installedLocation = Utilities.GetInstalledPath(); if (string.IsNullOrEmpty(installedLocation) && System.Windows.Forms.MessageBox.Show( string.Format(context.API.GetTranslation("flowlauncher_plugin_everything_installing_select"), Environment.NewLine), context.API.GetTranslation("flowlauncher_plugin_everything_installing_title"), System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { // Solves single thread apartment (STA) mode requirement error when using OpenFileDialog Thread t = new Thread(() => { var dlg = new System.Windows.Forms.OpenFileDialog { InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) }; var result = dlg.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK && !string.IsNullOrEmpty(dlg.FileName)) { installedLocation = dlg.FileName; } }); // Run your code from a thread that joins the STA Thread t.SetApartmentState(ApartmentState.STA); t.Start(); t.Join(); } if (string.IsNullOrEmpty(installedLocation)) { 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_4_1_1009).ConfigureAwait(false); context.API.ShowMsg(context.API.GetTranslation("flowlauncher_plugin_everything_installing_title"), context.API.GetTranslation("flowlauncher_plugin_everything_installationsuccess_subtitle"), "", useMainWindowAsOwner: false); _settings.EverythingInstalledPath = "C:\\Program Files\\Everything\\Everything.exe"; FilesFolders.OpenPath(_settings.EverythingInstalledPath); }).ContinueWith(t => { _context.API.LogException("Everything.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 { _settings.EverythingInstalledPath = installedLocation; } } var pluginDirectory = context.CurrentPluginMetadata.PluginDirectory; const string sdk = "EverythingSDK"; var bundledSdkDirectory = Path.Combine(pluginDirectory, sdk, CpuType()); var sdkPath = Path.Combine(bundledSdkDirectory, DLL); _api.Load(sdkPath); }
public void Init(PluginInitContext context) { this._context = context; context.API.GlobalKeyboardEvent += API_GlobalKeyboardEvent; }
protected override void InitInternal(PluginInitContext context) { allPlugins = context.Plugins; changeQuery = context.ChangeQuery; }
public void Init(PluginInitContext ctx) { context = ctx; }
public ContextMenu(PluginInitContext context, Settings settings, SettingsViewModel vm) { Context = context; Settings = settings; ViewModel = vm; }
public void Init(PluginInitContext context) { this.context = context; S.CoreStuff.Initialize(); }
public void Init(PluginInitContext context) { _context = context; _executor = UserQueryExecutorFactory.Create(context); }
public void Init(PluginInitContext context) { this.context = context; }
public void Init(PluginInitContext context) { browser = GetDefaultBrowserPath(); currentPath = context.CurrentPluginMetadata.PluginDirecotry; allBookmarks = new ReadBookmarks().GetBookmarks(currentPath); }
public void Init(PluginInitContext context) { _context = context; }
public void Init(PluginInitContext context) { Startup.Initialize(new PluginContext(context)); _engine = Startup.Resolve <IEngine>(); }
public ContextMenu(PluginInitContext context) { Context = context; }
public void InitSync(PluginInitContext context) { _context = context; loadSettings(); IndexPrograms(); }
public void Init(PluginInitContext context) { mGlosbeHelper = new GlosbeHelper(); }
private readonly string equalCheckPattern = @"(\d+(\.\d{1,2})?)?\s([A-Za-z]{3})\s([=])\s([A-Za-z]{3})"; // 10 usd = vnd public void Init(PluginInitContext context) { _context = context; _utils = new Utils(); }
public void Init(PluginInitContext context) { this.context = context; LoadCommands(); }
protected override void InitInternal(PluginInitContext context) { this.context = context; LoadPrograms(); }
public void Init(PluginInitContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); _context.API.ThemeChanged += OnThemeChanged; UpdateUWPIconPath(_context.API.GetCurrentTheme()); }
public void Init(PluginInitContext context) { this.context = context; random = new System.Random(); }
public void Init(PluginInitContext context) { _context = context; _contextMenuLoader = new ContextMenuLoader(context); InitialDriverList(); }