/// <inheritdoc /> protected override void PluginInit() { GlobalConfig = Svc.Configuration.Load <ImportGlobalCfg>().Result ?? new ImportGlobalCfg(); var colKno = Svc.SM.Collection.GetKnoFilePath(); var colCfg = GlobalConfig.CollectionConfigs.SafeGet(colKno); if (colCfg == null) { GlobalConfig.CollectionConfigs[colKno] = colCfg = new ImportCollectionCfg(); } FeedsConfig = colCfg.Feeds; WebConfig = colCfg.Websites; Svc.SM.UI.ElementWdw.OnAvailable += new ActionProxy(ElementWindow_OnAvailable); Svc.HotKeyManager .RegisterGlobal( "Import", "Import content from the web", HotKeyScope.Global, new HotKey(Key.A, KeyModifiers.CtrlAltShift), ImportFromTheWeb); }
/// <inheritdoc /> protected override void OnCollectionSelected(SMCollection col) { base.OnCollectionSelected(col); ImportConfig = Svc.CollectionConfiguration.Load <ImportCollectionCfg>() ?? new ImportCollectionCfg(); _importService = new ImportPluginService(); CreateBrowserRegistryKeys(); PublishService <IImportPluginService, ImportPluginService>(_importService, ImportConst.ChannelName); }