Пример #1
0
        public void Run()
        {
            try
            {
                IDevice device = SelectDevice();

                deviceConnector.UseDevice(device);

                IDirectory rootDirectory;
                using (IBusyIndicator busyIndicator = interactor.SetBusy())
                {
                    rootDirectory = deviceConnector.ReadMetadataOfAllFiles();
                }

                IFileOperation operation = interactor.CreateFileOperation(rootDirectory);

                using (IBusyIndicator busyIndicator = interactor.SetBusy())
                {
                    Execute(operation);
                }

                interactor.NotifySuccess(operation);
            }
            catch (NoDeviceConnectedException)
            {
                interactor.NotifyNoDeviceConnected();
            }
            catch (NoDeviceSelectedException)
            {
                interactor.NotifyNoDeviceSelected();
            }
            catch (ExecutionFailedException ex)
            {
                interactor.NotifyFileOperationFailed(ex.Message);
            }
        }