public NewLibraryBuilder(Uri libraryPath, ITrackFactory trackFactory, BackgroundWorker backgroundWorker) { _libraryPath = libraryPath; _trackFactory = trackFactory; _backgroundWorker = backgroundWorker; Library = new Model.Library { IsDirty = true }; }
private void LibraryNew_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.FolderBrowserDialog(); dialog.SelectedPath = _filesPath; System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { var processor = new Func <BackgroundWorker, Library.Model.Library>(bw => CreateNewLibrary(bw, dialog.SelectedPath)); var processingWindow = BootLoader.Resolve <ProcessingWindow>("processor", processor); processingWindow.Left = Left + Width / 2 - processingWindow.Width / 2; processingWindow.Top = Top + Height / 2 - processingWindow.Height / 2; processingWindow.ShowDialog(); _library = (Library.Model.Library)processingWindow.Result; SaveLibrary(); BindLibrary(); } }
public MainWindow(ITrackFactory trackFactory, IAppDataPersister <Library.Model.Library> libraryPersister) { _trackFactory = trackFactory; _libraryPersister = libraryPersister; InitializeComponent(); // Defaults Left = Settings.Default.MainWindowLeft; Top = Settings.Default.MainWindowTop; Width = Settings.Default.MainWindowWidth; Height = Settings.Default.MainWindowHeight; MainGrid.ColumnDefinitions.First(c => c.Name == "NavigationColumn").Width = new GridLength(20, GridUnitType.Star); MainGrid.ColumnDefinitions.First(c => c.Name == "ContentColumn").Width = new GridLength(80, GridUnitType.Star); Closing += MainWindow_Closing; _filesPath = @"M:\VA"; _library = _libraryPersister.Load(LibraryFileName) ?? new Library.Model.Library(); BindLibrary(); _mediaPlayer = new WindowsMediaPlayer(); _mediaPlayer.Volume = .5d; }
public MainWindow(ITrackFactory trackFactory, IAppDataPersister<Library.Model.Library> libraryPersister) { _trackFactory = trackFactory; _libraryPersister = libraryPersister; InitializeComponent(); // Defaults Left = Settings.Default.MainWindowLeft; Top = Settings.Default.MainWindowTop; Width = Settings.Default.MainWindowWidth; Height = Settings.Default.MainWindowHeight; MainGrid.ColumnDefinitions.First(c => c.Name == "NavigationColumn").Width = new GridLength(20, GridUnitType.Star); MainGrid.ColumnDefinitions.First(c => c.Name == "ContentColumn").Width = new GridLength(80, GridUnitType.Star); Closing += MainWindow_Closing; _filesPath = @"M:\VA"; _library = _libraryPersister.Load(LibraryFileName) ?? new Library.Model.Library(); BindLibrary(); _mediaPlayer = new WindowsMediaPlayer(); _mediaPlayer.Volume = .5d; }
private void LibraryNew_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.FolderBrowserDialog(); dialog.SelectedPath = _filesPath; System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { var processor = new Func<BackgroundWorker, Library.Model.Library>(bw => CreateNewLibrary(bw, dialog.SelectedPath)); var processingWindow = BootLoader.Resolve<ProcessingWindow>("processor", processor); processingWindow.Left = Left + Width / 2 - processingWindow.Width / 2; processingWindow.Top = Top + Height / 2 - processingWindow.Height / 2; processingWindow.ShowDialog(); _library = (Library.Model.Library)processingWindow.Result; SaveLibrary(); BindLibrary(); } }