Ejemplo n.º 1
0
        public void Scan(string source)
        {
            var mainVM = StaticResolver.Resolve <MainViewModel>();

            DispatchUtilities.Invoke(() =>
            {
                mainVM.ScanFromAutoplay(source);
            });
        }
Ejemplo n.º 2
0
        public void Encode(string source, string destination, string preset, string picker)
        {
            var processingService = StaticResolver.Resolve <ProcessingService>();

            DispatchUtilities.Invoke(() =>
            {
                processingService.Process(source, destination, preset, picker);
            });
        }
Ejemplo n.º 3
0
        public void Scan(string source)
        {
            var mainVM = StaticResolver.Resolve <MainViewModel>();

            DispatchUtilities.Invoke(() =>
            {
                try
                {
                    mainVM.ScanFromAutoplay(source);
                }
                catch (Exception exception)
                {
                    throw new FaultException <AutomationError>(new AutomationError {
                        Message = exception.Message
                    });
                }
            });
        }
Ejemplo n.º 4
0
        public void Encode(string source, string destination, string preset, string picker)
        {
            var processingService = StaticResolver.Resolve <ProcessingService>();

            DispatchUtilities.Invoke(() =>
            {
                try
                {
                    processingService.Process(source, destination, preset, picker);
                }
                catch (Exception exception)
                {
                    throw new FaultException <AutomationError>(new AutomationError {
                        Message = exception.Message
                    });
                }
            });
        }
Ejemplo n.º 5
0
        public void ImportQueue(string filePath)
        {
            var queueImporter = StaticResolver.Resolve <IQueueImportExport>();

            DispatchUtilities.Invoke(() =>
            {
                try
                {
                    queueImporter.Import(filePath);
                    this.ShowMessage(MainRes.QueueImportSuccessMessage);
                }
                catch (Exception)
                {
                    this.ShowMessage(MainRes.QueueImportErrorMessage);
                    throw;
                }
            });
        }
Ejemplo n.º 6
0
        public void ImportPreset(string filePath)
        {
            var presetImporter = StaticResolver.Resolve <IPresetImportExport>();

            DispatchUtilities.Invoke(() =>
            {
                try
                {
                    Preset preset = presetImporter.ImportPreset(filePath);
                    this.ShowMessage(string.Format(MainRes.PresetImportSuccessMessage, preset.Name));
                }
                catch (Exception)
                {
                    this.ShowMessage(MainRes.PresetImportErrorMessage);
                    throw;
                }
            });
        }
Ejemplo n.º 7
0
        public LogWindow()
        {
            this.InitializeComponent();

            this.PopulateLogColorBrushMapping();
            this.listColumn.Width = new GridLength(Config.LogListPaneWidth);

            this.Loaded += (sender, e) =>
            {
                this.logTextBox.ScrollToEnd();
            };

            this.logCoordinator.Logs
            .Connect()
            .OnItemAdded(addedLogViewModel =>
            {
                DispatchUtilities.Invoke(() =>
                {
                    this.logCoordinator.SelectedLog = addedLogViewModel;
                    this.logsListBox.ScrollIntoView(addedLogViewModel);
                });
            })
            .Subscribe();

            this.logCoordinator.WhenAnyValue(x => x.SelectedLog).Subscribe(selectedLog =>
            {
                if (selectedLog != null)
                {
                    this.DisconnectFromLogger();
                    this.ConnectToLogger(selectedLog.Logger);
                }
            });

            this.appThemeService.AppThemeObservable.Skip(1).Subscribe(_ =>
            {
                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    this.PopulateLogColorBrushMapping();
                    this.logParagraph.Inlines.Clear();
                    this.AddExistingLogEntries();
                }));
            });
        }
Ejemplo n.º 8
0
        public void ImportQueue(string filePath)
        {
            var queueImporter = Ioc.Get <IQueueImportExport>();

            DispatchUtilities.Invoke(() =>
            {
                try
                {
                    queueImporter.Import(filePath);
                    this.ShowMessage(MainRes.QueueImportSuccessMessage);
                }
                catch (Exception exception)
                {
                    this.ShowMessage(MainRes.QueueImportErrorMessage);
                    throw new FaultException <AutomationError>(new AutomationError {
                        Message = exception.Message
                    });
                }
            });
        }
Ejemplo n.º 9
0
        public void ImportPreset(string filePath)
        {
            var presetImporter = Ioc.Get <IPresetImportExport>();

            DispatchUtilities.Invoke(() =>
            {
                try
                {
                    Preset preset = presetImporter.ImportPreset(filePath);
                    this.ShowMessage(string.Format(MainRes.PresetImportSuccessMessage, preset.Name));
                }
                catch (Exception exception)
                {
                    this.ShowMessage(MainRes.PresetImportErrorMessage);
                    throw new FaultException <AutomationError>(new AutomationError {
                        Message = exception.Message
                    });
                }
            });
        }
Ejemplo n.º 10
0
        public void SetChosenTracks(List <int> chosenAudioTracks, SourceTitle selectedTitle)
        {
            DispatchUtilities.Invoke(() =>
            {
                int previousIndex = this.TargetStreamIndex;

                this.targetStreams.Clear();
                this.targetStreams.Add(new TargetStreamViewModel {
                    Text = CommonRes.All
                });

                int shownStreams = Math.Max(previousIndex, chosenAudioTracks.Count);

                for (int i = 0; i < shownStreams; i++)
                {
                    string details = null;
                    if (i < chosenAudioTracks.Count && selectedTitle != null)
                    {
                        details = selectedTitle.AudioList[chosenAudioTracks[i] - 1].Description;
                    }

                    this.targetStreams.Add(
                        new TargetStreamViewModel
                    {
                        Text         = string.Format(CommonRes.StreamChoice, (i + 1)),
                        TrackDetails = details
                    });
                }

                // Set to -1, then back to real index in order to force a refresh on the ComboBox
                this.targetStreamIndex = -1;
                this.RaisePropertyChanged(nameof(this.TargetStreamIndex));

                this.targetStreamIndex = previousIndex;
                this.RaisePropertyChanged(nameof(this.TargetStreamIndex));
            });
        }