/// <summary>
        /// Called when [uninstall flutter].
        /// </summary>
        /// <param name="flutter">The flutter.</param>
        private async void OnUninstallFlutter(Flutter flutter)
        {
            var uiContext = SynchronizationContext.Current;

            var uninstallConfirmation = MessageBox.Show(@"Are you sure you want to uninstall '" + flutter.Name + "'?"
                                                        , @"Uninstall Confirmation", MessageBoxButton.YesNo);

            if (uninstallConfirmation == MessageBoxResult.No)
            {
                return;
            }
            UninstallInProgress = true;
            StatusLog.Clear();
            ProgressPopupVisibility = true;

            var cancellationToken = new CancellationTokenSource();

            var uninstallResult = await DynamicTargetService.Uninstall(flutter, cancellationToken.Token,
                                                                       result =>
            {
                if (result.Status == OpenSourceUnInstallFlags.StatusUpdate)
                {
                    StatusLog.Add(result.Message);
                }
                if (result.Status == OpenSourceUnInstallFlags.Success)
                {
                    StatusLog.Add(string.Format("Uninstallation of flutter \"{0}\" completed successfully.", flutter.Name));
                }
            },
                                                                       errorCallback =>
            {
                var statusMessage = string.Format("Uninstallation of flutter \"{0}\" was unsuccessful. Please try again. If for any reason the" +
                                                  "the error still remains after trying to uninstall again. Please contact Monahrq technical assistance.",
                                                  flutter.Name);
                uiContext.Send(x => StatusLog.Add(statusMessage), null);
                Logger.Write(errorCallback.Exception);

                //if (FlutterItems.Contains(flutter))
                //    FlutterItems.Remove(flutter);
            });

            if (FlutterItems.Contains(flutter))
            {
                FlutterItems.Remove(flutter);
            }
            UninstallInProgress = false;
        }
Exemplo n.º 2
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            this.TextBlock_Path.Text = string.Join("\n", Variables.Paths);
            DotNetCore DotNetDependency = new DotNetCore();

            if (DotNetDependency.VerifyInstallationStatus())
            {
                this.TextBlock_DotNetCore.Text = string.Join("; ", DotNetDependency.GetInstalledVersions());
            }
            else
            {
                this.TextBlock_DotNetCore.Text = "Not Installed";
            }

            NodeJS NodeJSDependency = new NodeJS();

            if (NodeJSDependency.VerifyInstallationStatus())
            {
                this.TextBlock_NodeJS.Text = string.Join("; ", NodeJSDependency.GetInstalledVersions());
            }
            else
            {
                this.TextBlock_DotNetCore.Text = "Not Installed";
            }

            Python PythonDependency = new Python();

            if (PythonDependency.VerifyInstallationStatus())
            {
                this.TextBlock_Python.Text = string.Join("; ", PythonDependency.GetInstalledVersions());
            }
            else
            {
                this.TextBlock_Python.Text = "Not Installed";
            }
            Flutter FlutterDependency = new Flutter();

            if (FlutterDependency.VerifyInstallationStatus())
            {
                this.TextBlock_Flutter.Text = string.Join("; ", FlutterDependency.GetInstalledVersions());
            }
            else
            {
                this.TextBlock_Flutter.Text = "Not Installed";
            }

            Dart DartDependency = new Dart();

            if (DartDependency.VerifyInstallationStatus())
            {
                this.TextBlock_Dart.Text = string.Join("; ", DartDependency.GetInstalledVersions());
            }
            else
            {
                this.TextBlock_Dart.Text = "Not Installed";
            }

            Git GitDependency = new Git();

            if (GitDependency.VerifyInstallationStatus())
            {
                this.TextBlock_Git.Text = string.Join("; ", GitDependency.GetInstalledVersions());
            }
            else
            {
                this.TextBlock_Git.Text = "Not Installed";
            }
        }