private bool ShouldFindSuperMemo(CoreCfg startupCfg, NativeDataCfg nativeDataCfg) { return(string.IsNullOrWhiteSpace(startupCfg.SuperMemo.SMBinPath) || SuperMemoFinderUtil.CheckSuperMemoExecutable( nativeDataCfg, startupCfg.SuperMemo.SMBinPath, out _, out _) == false); }
public SuperMemoFinder(NativeDataCfg nativeDataCfg, CoreCfg startupCfg) { _nativeDataCfg = nativeDataCfg; _startupCfg = startupCfg; _initialIsSetup = ShouldFindSuperMemo(startupCfg, nativeDataCfg) == false; Description = BuildDescriptionText(); BrowseCommand = new RelayCommand(Browse); InitializeComponent(); }
public static bool Run(NativeDataCfg nativeDataCfg, CoreCfg startupCfg) { var setup = new SMASetup(nativeDataCfg, startupCfg); if (setup.IsSetupRequired() == false) { return(true); } setup.ShowDialog(); return(setup.DialogResult ?? false); }
public CollectionSelectionWindow(CoreCfg startupCfg) { _startupCfg = startupCfg; SavedCollections = startupCfg.Collections; InitializeComponent(); if (SavedCollections.Count > 0) { lbCollections.SelectedIndex = 0; } Loaded += CollectionSelectionWindow_Loaded; }
protected SMASetup(NativeDataCfg nativeDataCfg, CoreCfg startupCfg) { NextCommand = new RelayCommand(ShowNextScreen /*, CanNextExecute*/); BackCommand = new RelayCommand(ShowPreviousScreen); Screens = new ObservableCollection <SMASetupScreenBase> { new TermsOfLicense(startupCfg), new SuperMemoFinder(nativeDataCfg, startupCfg), new ImportCollections(startupCfg), new PluginSetup(), }; InitializeComponent(); }
public static void ShowIfUpdated(CoreCfg cfg) { try { var changeLogs = ChangeLogControl.LoadChangeLogs(); var changeLogCrc32 = changeLogs.GetCrc32(); if (changeLogCrc32 != cfg.Updates.ChangeLogLastCrc32) { cfg.Updates.ChangeLogLastCrc32 = changeLogCrc32; SMA.Core.Configuration.Save(cfg).RunAsync(); new ChangeLogWindow().ShowDialog(); } } catch (Exception ex) { LogTo.Error(ex, "An exception occured while checking whether to display the change log at startup"); } }
public TermsOfLicense(CoreCfg startupCfg) { StartupCfg = startupCfg; InitializeComponent(); }
public ImportCollections(CoreCfg startupCfg) { StartupCfg = startupCfg; InitializeComponent(); }