public ExportPanelViewModel(MainModel mainModel, LibgenObjectType libgenObjectType, IWindowContext parentWindowContext) : base(mainModel) { this.libgenObjectType = libgenObjectType; this.parentWindowContext = parentWindowContext; localization = mainModel.Localization.CurrentLanguage.ExportPanel; SelectPathCommand = new Command(SelectPath); ExportCommand = new Command(Export); CancelCommand = new Command(Cancel); CancelExportCommand = new Command(CancelExport); ShowResultCommand = new Command(ShowResult); CloseCommand = new Command(Close); Initialize(); }
public Language(List <Translation> prioritizedTranslationList, decimal percentTranslated) { translations = prioritizedTranslationList; mainWindow = null; setupWizardWindow = null; setupWizardProxySettingsWindowLocalizator = null; searchTab = null; nonFictionSearchResultsTab = null; fictionSearchResultsTab = null; sciMagSearchResultsTab = null; commonDetailsTab = null; nonFictionDetailsTab = null; fictionDetailsTab = null; sciMagDetailsTab = null; import = null; exportPanel = null; nonFictionExporter = null; fictionExporter = null; sciMagExporter = null; synchronization = null; database = null; databaseError = null; sqlDebugger = null; downloadManager = null; applicationUpdate = null; settings = null; about = null; messageBox = null; errorWindow = null; Translation mainTranslation = prioritizedTranslationList.First(); Name = mainTranslation.General?.Name?.Trim() ?? String.Empty; LocalizedName = mainTranslation.General?.LocalizedName?.Trim() ?? String.Empty; if (!String.IsNullOrEmpty(Name) && !String.IsNullOrEmpty(LocalizedName)) { DisplayName = $"{Name} ({LocalizedName})"; } else { DisplayName = "Error"; } CultureCode = mainTranslation.General?.CultureCode?.Trim() ?? String.Empty; TranslatorName = mainTranslation.General?.TranslatorName ?? "unknown"; PercentTranslated = percentTranslated; Formatter = new LanguageFormatter(prioritizedTranslationList); }