Beispiel #1
0
        public async void RunExecute()
        {
            try
            {
                if (!ValidatePaths())
                {
                    return;
                }
                IFilesLoader filesLoader = new FilesLoader();
                CDBuilder    cdBuilder   = new CDBuilder();
                foreach (var(nameInIso, fullName) in filesLoader.GetFiles(SourcePath))
                {
                    cdBuilder.AddFile(nameInIso, fullName);
                }

                IsNotRunning = false;
                await cdBuilder.BuildAsync(DestinationPath,
                                           (current, max) => ProgressValue = current / (double)max * 100);

                ProgressValue = 100;
                IsNotRunning  = true;
                MessageBox.Show("Operation complete");
            }
            catch (Exception exception)
            {
                MessageBox.Show(
                    $"Problem has occurred during processing. Details below:{Environment.NewLine}{exception.Message}");
                IsNotRunning  = true;
                ProgressValue = 0;
            }
        }