Exemplo n.º 1
0
        public void Done(bool isSuccess)
        {
            if (outpuTimer != null)
            {
                outpuTimer.Stop(true);
            }
            AppendMessage("Done");
            ProgressBar.Visible = false;
            Ok.Enabled          = true;
            Ok.Focus();
            AcceptButton  = Ok;
            Abort.Enabled = false;
#if !__MonoCS__
            if (GitCommands.Settings.RunningOnWindows() && TaskbarManager.IsPlatformSupported)
            {
                try
                {
                    TaskbarManager.Instance.SetProgressState(isSuccess
                                                                 ? TaskbarProgressBarState.Normal
                                                                 : TaskbarProgressBarState.Error);

                    TaskbarManager.Instance.SetProgressValue(100, 100);
                }
                catch (InvalidOperationException) { }
            }
#endif

            if (isSuccess)
            {
                picBoxSuccessFail.Image = GitUI.Properties.Resources.success;
            }
            else
            {
                picBoxSuccessFail.Image = GitUI.Properties.Resources.error;
            }
            splitContainer1.Panel2Collapsed = false;

            errorOccurred = !isSuccess;

            if (showOnError && !isSuccess)
            {
                // For some reason setting the state to normal interferes with
                // proper parent centering...
                WindowState = FormWindowState.Normal;
                CenterToParent();
                Visible = true;
            }

            if (isSuccess && (showOnError || (UseDialogSettings && GitCommands.Settings.CloseProcessDialog)))
            {
                Close();
            }
        }
Exemplo n.º 2
0
        public void Done(bool isSuccess)
        {
            ProcessOutputTimer.Stop();
            AddOutput("Done");
            ProgressBar.Visible = false;
            Ok.Enabled          = true;
            Ok.Focus();
            AcceptButton  = Ok;
            Abort.Enabled = false;
#if !__MonoCS__
            if (TaskbarManager.IsPlatformSupported)
            {
                try
                {
                    TaskbarManager.Instance.SetProgressState(isSuccess
                                                                 ? TaskbarProgressBarState.Normal
                                                                 : TaskbarProgressBarState.Error);

                    TaskbarManager.Instance.SetProgressValue(100, 100);
                }
                catch (InvalidOperationException) { }
            }
#endif

            SuccessImage.Visible            = isSuccess;
            ErrorImage.Visible              = !isSuccess;
            errorOccurred                   = !isSuccess;
            splitContainer5.Panel2Collapsed = false;

            if (showOnError && !isSuccess)
            {
                // For some reason setting the state to normal interferes with
                // proper parent centering...
                WindowState = FormWindowState.Normal;
                CenterToParent();
                Visible = true;
            }

            if (isSuccess && (showOnError || (UseDialogSettings && GitCommands.Settings.CloseProcessDialog)))
            {
                Close();
            }
        }