Exemplo n.º 1
0
 public NewLibraryBuilder(Uri libraryPath, ITrackFactory trackFactory, BackgroundWorker backgroundWorker)
 {
     _libraryPath = libraryPath;
     _trackFactory = trackFactory;
     _backgroundWorker = backgroundWorker;
     Library = new Model.Library
     {
         IsDirty = true
     };
 }
Exemplo n.º 2
0
 public NewLibraryBuilder(Uri libraryPath, ITrackFactory trackFactory, BackgroundWorker backgroundWorker)
 {
     _libraryPath      = libraryPath;
     _trackFactory     = trackFactory;
     _backgroundWorker = backgroundWorker;
     Library           = new Model.Library
     {
         IsDirty = true
     };
 }
Exemplo n.º 3
0
        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();
            }
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
        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();
            }
        }