Exemplo n.º 1
0
 private void CloneSolution()
 {
     SetDialog("Cloning...");
     ThreadManager.Instance.ScheduleTask(() =>
     {
         var isError          = false;
         var errorMessage     = string.Empty;
         var clonedSolutionId = Guid.Empty;
         try
         {
             //TODO: add version and description
             clonedSolutionId = CurrentSolutionManager.CloneSolution(CurrentSolution.Id, NewName, NewUniqueName);
         }
         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.ClonedSolutionId = clonedSolutionId;
                 _window.Close();
             }
             UnsetDialog();
         });
     }, "Cloning solution...", _cloneTaskId);
 }