public MainWindow() { InitializeComponent(); _time2 = TimeSpan.FromSeconds(3); _timer2 = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate { if (_time2.Seconds == 3) { btnTopMenuShow_Click(objectNew, new RoutedEventArgs()); } if (_time2 == TimeSpan.Zero) { _timer2.Stop(); } _time2 = _time2.Add(TimeSpan.FromSeconds(-1)); if (_time2.Seconds == 0) { btnTopMenuHide_Click(objectNew, new RoutedEventArgs()); } }, Application.Current.Dispatcher); _timer2.Start(); this.LibraryVM = new LibraryVM(); LibraryVM.Grid = MainGrid; DataContext = LibraryVM; }
public void Handle(GameContentInitialSynced message) { if (LibraryVM != null) { LibraryVM.Setup(); } }
public void Handle(ActiveGameChangedForReal message) { if (message.Game.SupportsMods()) { LibraryVM.Setup(); } }
public void Handle(ActiveGameChangedForReal message) { if (!message.Game.SupportsServers()) { return; } AssignServerList(); LibraryVM.Setup(); }
private async Task OpenImportFolderDialogThenImport() { var dialog = new FolderBrowserDialog(); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { await LibraryVM.ImportAsync(new string[] { dialog.SelectedPath }); } }
private async Task OpenEncryptionStartingDialog() { var dialog = new EncryptionStartingDialog(); if (dialog.ShowDialog() == true) { await LibraryVM.StartEncryption(dialog.Password); } }
private async Task OpenUnencryptingDialog() { var dialog = new InputPasswordDialog("暗号化を解除するにはパスワードを入力する必要があります。"); if (dialog.ShowDialog() == true) { await LibraryVM.StartUnencryption(dialog.Password); } }
public IActionResult CreateSheet(LibraryVM libraryVM) { var sheet = libraryVM.Sheet; var cat = _libraryUnitOfWork.CategoryRepository.GetAll().First(x => x.Name == libraryVM.SelectedCategory); sheet.Category = cat; _librarianUC.CreateANewSheet(sheet); return(RedirectToAction("AllSheets")); }
public IActionResult CreateSheet() { var allCategories = _libraryUnitOfWork.CategoryRepository.GetAll().ToList(); var libraryVM = new LibraryVM { AllCategories = allCategories, }; return(View(libraryVM)); }
public IActionResult UploadSheetPartToSheet() { var libraryVM = new LibraryVM { AllSheets = _libraryUnitOfWork.SheetRepository.GetAll().ToList(), AllInstruments = _libraryUnitOfWork.InstrumentRepository.GetAll().ToList(), }; return(View(libraryVM)); }
private async Task OpenImportFileDialogThenImport() { var dialog = new System.Windows.Forms.OpenFileDialog(); dialog.Multiselect = true; dialog.Filter = "ALL|*.*|JPEG file|*.jpg;*.jpeg|PNG file|*.png|GIF file|*.gif|BMP file|*.bmp"; if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { await LibraryVM.ImportAsync(dialog.FileNames.ToArray()); } }
private async Task OpenImportLibraryDialog() { var dialog = new FolderSelectDialog { Title = "ライブラリディレクトリの場所" }; if (dialog.ShowDialog() == true) { await LibraryVM.ImportLibrary(dialog.FileName); } }
public IActionResult SheetDetails(int id) { var sheet = _libraryUnitOfWork.SheetRepository.GetById(id); var sheetParts = _chiefUC?.GetAllSheetPartsBySheet(id); var libraryVM = new LibraryVM { Sheet = sheet, SheetPartsFromSheet = sheetParts, }; return(View(libraryVM)); }
public void NewContentTab(IEnumerable <BookViewModel> list) { var newTabViewModel = (App.Current.Resources["Ioc"] as IUnityContainer).Resolve <IDocumentViewModelBase>("ContentDocumentViewModel"); newTabViewModel.Title = "Filtered"; newTabViewModel.BookCabinet = LibraryVM.CreateBookStorage(); newTabViewModel.BookCabinet.BookSource = new ObservableCollection <BookViewModel>(); newTabViewModel.BookCabinet.BookSource.AddRange(list); newTabViewModel.BookCabinet.Sorting = (App.Current.MainWindow.DataContext as MainWindowViewModel).ActiveDocumentViewModel.BookCabinet.Sorting; newTabViewModel.BookCabinet.DisplayType = (App.Current.MainWindow.DataContext as MainWindowViewModel).ActiveDocumentViewModel.BookCabinet.DisplayType; DockingDocumentViewModels.Add(newTabViewModel); (LibraryVM as IObservable <BookCollectionChanged>) .Subscribe(newTabViewModel.BookCabinet as IObserver <BookCollectionChanged>) .AddTo(_disposable); newTabViewModel.IsVisible = true; }
public void NewSearchTab(ObservableCollection <BookViewModel> onStage) { var newTabViewModel = (App.Current.Resources["Ioc"] as IUnityContainer).Resolve <IDocumentViewModelBase>("SearchDocumentViewModel"); newTabViewModel.Title = "Search results"; newTabViewModel.BookCabinet = LibraryVM.CreateBookStorage(); newTabViewModel.BookCabinet.BookSource = new ObservableCollection <BookViewModel>(onStage); newTabViewModel.BookCabinet.Sorting = (App.Current.MainWindow.DataContext as MainWindowViewModel).ActiveDocumentViewModel.BookCabinet.Sorting; newTabViewModel.BookCabinet.DisplayType = (App.Current.MainWindow.DataContext as MainWindowViewModel).ActiveDocumentViewModel.BookCabinet.DisplayType; DockingDocumentViewModels.Add(newTabViewModel); (LibraryVM as IObservable <BookCollectionChanged>) .Subscribe(newTabViewModel.BookCabinet as IObserver <BookCollectionChanged>) .AddTo(_disposable); newTabViewModel.IsVisible = true; newTabViewModel.IsSelected = true; ActiveDocumentViewModel = newTabViewModel; }
public IActionResult UploadSheetPartToSheet(LibraryVM libraryVM) { var selectedInstruments = libraryVM.AllInstruments.Where(inst => inst.IsSelected == true).ToList(); var sheet = _chiefUC.GetAllSheets().FirstOrDefault(x => x.Name == libraryVM.SelectedSheet); var file = libraryVM.SheetPartFile; var stream = file.OpenReadStream(); foreach (var selectedInstru in selectedInstruments) { var instru = _libraryUnitOfWork.InstrumentRepository.GetAll().FirstOrDefault(x => x.Id == selectedInstru.Id); var sheetPart = new SheetPartTO { Instrument = instru, Part = libraryVM.SheetPart.Part, Sheet = sheet }; var uploadedSheetPart = _librarianUC.UploadSheetPartInSheet(sheetPart, stream); } return(RedirectToAction("LibraryIndex")); }
private void RegisterCommands() { AboutSunctumCommand = new DelegateCommand(() => { OpenVersionDialog(); }); ClearSearchResultCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.ClearSearchResult(); }); DisplaySideBySideCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.DisplayType = Domain.Logic.DisplayType.DisplayType.SideBySide; }); DetailsCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.DisplayType = Domain.Logic.DisplayType.DisplayType.Details; }); EncryptionStartingCommand = new DelegateCommand(async() => { await OpenEncryptionStartingDialog(); }); ExitApplicationCommand = new DelegateCommand(() => { Close(); }); GeneralCancelCommand = new DelegateCommand(() => { GeneralCancel(); }); ImportFilesCommand = new DelegateCommand(async() => { await OpenImportFileDialogThenImport(); }); ImportFoldersCommand = new DelegateCommand(async() => { await OpenImportFolderDialogThenImport(); }); ImportLibraryCommand = new DelegateCommand(async() => { await OpenImportLibraryDialog(); }); OpenAuthorManagementDialogCommand = new DelegateCommand(() => { OpenAuthorManagementDialog(); }); OpenMetadataImportSettingDialogCommand = new DelegateCommand(() => { OpenMetadataImportSettingDialog(); }); OpenPowerSearchCommand = new DelegateCommand(() => { IDialogResult result = new Prism.Services.Dialogs.DialogResult(); DialogService.ShowDialog(nameof(PowerSearch), new DialogParameters() { { "Storage", ActiveDocumentViewModel.BookCabinet } }, ret => result = ret); }); OpenStatisticsDialogCommand = new DelegateCommand(() => { DialogService.ShowDialog(nameof(Views.Statistics)); }); OpenSwitchLibraryCommand = new DelegateCommand(async() => { bool changed = OpenSwitchLibraryDialogAndChangeWorkingDirectory(); if (changed) { CloseAllTab(); await LibraryVM.Reset(); await Initialize(false); } }); OpenSearchPaneCommand = new DelegateCommand(() => { this.ActiveDocumentViewModel.SearchPaneIsVisible = true; }); OpenTagManagementDialogCommand = new DelegateCommand(() => { OpenTagManagementDialog(); }); ReloadLibraryCommand = new DelegateCommand(async() => { CloseAllTab(); await LibraryVM.Reset(); await Initialize(false); }); ShowPreferenceDialogCommand = new DelegateCommand(() => { ShowPreferenceDialog(); }); ShowDuplicateBooksCommand = new DelegateCommand(() => { this.NewSearchTab(new ObservableCollection <BookViewModel>(BookFacade.FindDuplicateFingerPrint())); }); SortBookByAuthorAscCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByAuthorAsc; }); SortBookByAuthorDescCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByAuthorDesc; }); SortBookByCoverBlueAscCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByCoverBlueAsc; }); SortBookByCoverBlueDescCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByCoverBlueDesc; }); SortBookByCoverGreenAscCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByCoverGreenAsc; }); SortBookByCoverGreenDescCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByCoverGreenDesc; }); SortBookByCoverRedAscCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByCoverRedAsc; }); SortBookByCoverRedDescCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByCoverRedDesc; }); SortBookByLoadedAscCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByLoadedAsc; }); SortBookByLoadedDescCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByLoadedDesc; }); SortBookByTitleAscCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByTitleAsc; }); SortBookByTitleDescCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByTitleDesc; }); SortBookByFingerPrintAscCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByFingerPrintAsc; }); SortBookByFingerPrintDescCommand = new DelegateCommand(() => { ActiveDocumentViewModel.BookCabinet.Sorting = BookSorting.ByFingerPrintDesc; }); SwitchLibraryCommand = new DelegateCommand <RecentOpenedLibrary>(async(p) => { await LibraryVM.Reset(); Configuration.ApplicationConfiguration.WorkingDirectory = p.Path; Configuration.Save(Configuration.ApplicationConfiguration); await Initialize(false); }); ToggleDisplayAuthorPaneCommand = new DelegateCommand(() => { DisplayAuthorPane = !DisplayAuthorPane; if (DisplayAuthorPane) { if (!DockingPaneViewModels.Contains((PaneViewModelBase)AuthorPaneViewModel)) { DockingPaneViewModels.Add((PaneViewModelBase)AuthorPaneViewModel); } } else { DockingPaneViewModels.Remove((PaneViewModelBase)AuthorPaneViewModel); } }); ToggleDisplayInformationPaneCommand = new DelegateCommand(() => { DisplayInformationPane = !DisplayInformationPane; if (DisplayInformationPane) { if (!DockingPaneViewModels.Contains((PaneViewModelBase)InformationPaneViewModel)) { DockingPaneViewModels.Add((PaneViewModelBase)InformationPaneViewModel); } } else { DockingPaneViewModels.Remove((PaneViewModelBase)InformationPaneViewModel); } }); ToggleDisplayTagPaneCommand = new DelegateCommand(() => { DisplayTagPane = !DisplayTagPane; if (DisplayTagPane) { if (!DockingPaneViewModels.Contains((PaneViewModelBase)TagPaneViewModel)) { DockingPaneViewModels.Add((PaneViewModelBase)TagPaneViewModel); } } else { DockingPaneViewModels.Remove((PaneViewModelBase)TagPaneViewModel); } }); UnencryptionStartingCommand = new DelegateCommand(async() => { await OpenUnencryptingDialog(); }); UpdateBookByteSizeAllCommand = new DelegateCommand(async() => { await LibraryVM.UpdateBookByteSizeAll(); }); UpdateBookByteSizeStillNullCommand = new DelegateCommand(async() => { await LibraryVM.UpdateBookByteSizeStillNull(); }); UpdateBookTagCommand = new DelegateCommand(async() => { await LibraryVM.UpdateBookTag(); }); UpdateBookFingerPrintAllCommand = new DelegateCommand(async() => { await LibraryVM.UpdateBookFingerPrintAll(); }); UpdateBookFingerPrintStillNullCommand = new DelegateCommand(async() => { await LibraryVM.UpdateBookFingerPrintStillNull(); }); }
public AddBranchUCCMD(LibraryVM libraryVM) { LibraryVM = libraryVM; }
public AddEmployeeUCCMD(LibraryVM libraryVM) : base(libraryVM) { }
public LibInfoWin(LibraryVM vm) { InitializeComponent(); DataContext = vm; }
public AddUserUCCMD(LibraryVM libraryVM) : base(libraryVM) { }
public void Handle(GameContentInitialSynced message) { LibraryVM?.Setup(); }
protected BaseUCAddingCommand(LibraryVM LibraryVM) { this.LibraryVM = LibraryVM; }
public async Task Initialize(bool starting, bool shiftPressed = false) { if (starting) { LibraryVM.ProgressManager.PropertyChanged += ProgressManager_PropertyChanged; TagPaneViewModel.BuildContextMenus_Tags(); AuthorPaneViewModel.BuildContextMenus_Authors(); } WindowLeft = Configuration.ApplicationConfiguration.WindowRect.X; WindowTop = Configuration.ApplicationConfiguration.WindowRect.Y; WindowWidth = Configuration.ApplicationConfiguration.WindowRect.Width; WindowHeight = Configuration.ApplicationConfiguration.WindowRect.Height; if (shiftPressed || Configuration.ApplicationConfiguration.WorkingDirectory == null) { if (!OpenSwitchLibraryDialogAndChangeWorkingDirectory()) { Close(); return; } } CloseAllTab(); var authorSorting = Configuration.ApplicationConfiguration.AuthorSorting; if (authorSorting != null) { AuthorManager.Sorting = AuthorSorting.GetReferenceByName(authorSorting); } var tagSorting = Configuration.ApplicationConfiguration.TagSorting; if (tagSorting != null) { TagManager.Sorting = ImageTagCountSorting.GetReferenceByName(tagSorting); } SetMainWindowTitle(); HomeDocumentViewModel.ClearSearchResult(); InitializeWindowComponent(); ManageAppDB(); IncrementNumberOfBoots(); Configuration.ApplicationConfiguration.ConnectionString = Specifications.GenerateConnectionString(Configuration.ApplicationConfiguration.WorkingDirectory); ConnectionManager.SetDefaultConnection(Configuration.ApplicationConfiguration.ConnectionString, typeof(SQLiteConnection)); try { await LibraryVM.Initialize(); LibraryVM.UnlockIfLocked(); await LibraryVM.Load() .ContinueWith(_ => { HomeDocumentViewModel.BookCabinet = LibraryVM.CreateBookStorage(); (LibraryVM as IObservable <BookCollectionChanged>) .Subscribe(HomeDocumentViewModel.BookCabinet as IObserver <BookCollectionChanged>) .AddTo(_disposable); this.Subscribe((IObserver <ActiveTabChanged>)TagManager) .AddTo(_disposable); this.Subscribe((IObserver <ActiveTabChanged>)AuthorManager) .AddTo(_disposable); var sorting = Configuration.ApplicationConfiguration.BookSorting; if (sorting != null) { HomeDocumentViewModel.BookCabinet.Sorting = BookSorting.GetReferenceByName(sorting); } var displayType = Configuration.ApplicationConfiguration.DisplayType; if (displayType != null) { HomeDocumentViewModel.BookCabinet.DisplayType = DisplayType.GetReferenceByName(displayType); } ((DocumentViewModelBase)HomeDocumentViewModel).IsVisible = true; ((DocumentViewModelBase)HomeDocumentViewModel).IsSelected = true; SetEvent(); NotifyActiveTabChanged(); }); } catch (Exception e) { Close(); } }
public AddBookSaleUCCMD(LibraryVM libraryVM) : base(libraryVM) { }
public AddCustomerUCCMD(LibraryVM libraryVM) : base(libraryVM) { }
public AddRentalReportsUCCMD(LibraryVM libraryVM) : base(libraryVM) { }
public AddSaleReportsUCCMD(LibraryVM libraryVM) : base(libraryVM) { }