예제 #1
0
 public ConvertCommand(MappingsSourceViewModel receiver)
     : base("Convert Files", "Convert Files", typeof(ConvertCommand), new InputGestureCollection
 {
     new KeyGesture(Key.C, ModifierKeys.Control | ModifierKeys.Alt)
 })
 {
     _mappingsSource = receiver;
 }
예제 #2
0
 public AddVideoFilesCommand(MappingsSourceViewModel receiver)
     : base("Add Files", "Add Files", typeof(AddVideoFilesCommand), new InputGestureCollection
 {
     new KeyGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift)
 })
 {
     _mappingsSource = receiver;
 }
예제 #3
0
 public SaveFileCommand(MappingsSourceViewModel receiver)
     : base("Save File", "Save File", typeof(AddVideoFilesCommand), new InputGestureCollection
 {
     new KeyGesture(Key.S, ModifierKeys.Control)
 })
 {
     _mappingsSource = receiver;
 }
예제 #4
0
        public void Execute(object parameter)
        {
            var openFileDialog = new OpenFileDialog
            {
                Filter      = Constants.FileFilter,
                Multiselect = false
            };

            if (openFileDialog.ShowDialog() == true)
            {
                var reader = new MappingsSourceReader();
                var source = reader.Read(openFileDialog.FileName);

                MappingsSource = new MappingsSourceViewModel
                {
                    FileName = openFileDialog.FileName,

                    Mappings = new MappingsCollection(source.Mappings)
                };
            }
        }
예제 #5
0
        private void LoadSource(MappingsSourceViewModel source)
        {
            MediaContainer.Visibility = Visibility.Hidden;

            if (source == null)
            {
                return;
            }

            _current    = source;
            DataContext = _current;

            if (source == null)
            {
                return;
            }

            SaveFilesMenuItem.IsEnabled = true;
            AddFilesMenuItem.IsEnabled  = true;
            if (source.Mappings.Any())
            {
                ConvertFilesMenuItem.IsEnabled = true;
            }
        }