Пример #1
0
        private void MergeWithSuperSolutions()
        {
            string defaultPath = GetDefaultZipPath();
            var    path        = FileDialogManager.SelectPath(defaultPath);

            path = StringFormatter.GetPathWithLastSlash(path);

            SetDialog("Merging...");

            ThreadManager.Instance.ScheduleTask(() =>
            {
                var isError             = false;
                var errorMessage        = string.Empty;
                var mappingsWithBackpus = new Dictionary <string, string>();
                try
                {
                    UpdateDialogMessage($"Publishing all customizations...");
                    CurrentSolutionManager.PublishAll();
                    List <Solution> affectedSuperSolutions = GetAffectedSuperSolutions();
                    UpdateDialogMessage($"Cloning affected solutions... ({affectedSuperSolutions.Count})");
                    mappingsWithBackpus = CloneAffectedSolutions(affectedSuperSolutions);
                    CleanAndMergeSourceSolutions(affectedSuperSolutions, mappingsWithBackpus);
                    RemovedClonedBackupSolutions(affectedSuperSolutions, mappingsWithBackpus);
                    UpdateDialogMessage($"Exporting affected solutions...");
                    ExportAffectedSuperSolutions(affectedSuperSolutions, path);
                }
                catch (Exception ex)
                {
                    isError      = true;
                    errorMessage = ex.Message;
                }
                System.Windows.Application.Current.Dispatcher.Invoke(() =>
                {
                    if (isError)
                    {
                        MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                    else
                    {
                        _window.Close();
                    }
                    UnsetDialog();
                });
            }, string.Empty, _mergeTaskId);
        }
Пример #2
0
        private void DownloadSolution()
        {
            MessageBox.Show("Select forlder for donwload the solution from de Blobstorage");
            string defaultPath = GetDefaultZipPath();
            var    path        = FileDialogManager.SelectPath(defaultPath);

            path = StringFormatter.GetPathWithLastSlash(path);
            path = string.Format("{0}{1}", path, SelectedBlob);
            SetDialog("Downloading...");
            ThreadManager.Instance.ScheduleTask(() =>
            {
                var isError      = false;
                var errorMessage = string.Empty;
                try
                {
                    BlobService.Download(SelectedBlob.Name, path);
                }
                catch (Exception ex)
                {
                    isError      = true;
                    errorMessage = ex.Message;
                }
                System.Windows.Application.Current.Dispatcher.Invoke(() =>
                {
                    if (isError)
                    {
                        MessageBox.Show(errorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                    else
                    {
                        this.OutputPath = path;
                        _window.Close();
                    }
                    UnsetDialog();
                });
            }, string.Empty, _downloadTaskId);
        }