Exemplo n.º 1
0
 public void AddToTimer(string text)
 {
     lock (ProcessOutputTimer.linesToAdd)
     {
         ProcessOutputTimer.addLine(text);
     }
 }
Exemplo n.º 2
0
        public FormStatus(bool useDialogSettings)
            : base(true)
        {
            outpuTimer = new ProcessOutputTimer(AppendMessageCrossThread);
            syncContext = SynchronizationContext.Current;
            UseDialogSettings = useDialogSettings;

            InitializeComponent();
            Translate();
            if (UseDialogSettings)
                KeepDialogOpen.Checked = !GitCommands.Settings.CloseProcessDialog;
            else
                KeepDialogOpen.Hide();
        }
Exemplo n.º 3
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 (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.º 4
0
 private void Start()
 {
     if (TaskbarManager.IsPlatformSupported)
     {
         try
         {
             TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate);
         }
         catch (InvalidOperationException) { }
     }
     ProcessOutputTimer.Start(this);
     Reset();
     ProcessCallback(this);
 }
Exemplo n.º 5
0
        private void Start()
        {
#if !__MonoCS__
            if (GitCommands.Settings.RunningOnWindows() && TaskbarManager.IsPlatformSupported)
            {
                try
                {
                    TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate);
                }
                catch (InvalidOperationException) { }
            }
#endif
            ProcessOutputTimer.Start(this);
            Reset();
            ProcessCallback(this);
        }
Exemplo n.º 6
0
        public FormStatus(bool useDialogSettings)
            : base(true)
        {
            outpuTimer        = new ProcessOutputTimer(AppendMessageCrossThread);
            syncContext       = SynchronizationContext.Current;
            UseDialogSettings = useDialogSettings;

            InitializeComponent();
            Translate();
            if (UseDialogSettings)
            {
                KeepDialogOpen.Checked = !GitCommands.AppSettings.CloseProcessDialog;
            }
            else
            {
                KeepDialogOpen.Hide();
            }
        }
Exemplo n.º 7
0
        public void Done(bool isSuccess)
        {
            ProcessOutputTimer.Stop();
            AddOutput("Done");
            ProgressBar.Visible = false;
            Ok.Enabled          = true;
            Ok.Focus();
            AcceptButton  = Ok;
            Abort.Enabled = false;
            if (TaskbarManager.IsPlatformSupported)
            {
                try
                {
                    TaskbarManager.Instance.SetProgressState(isSuccess
                                                                 ? TaskbarProgressBarState.Normal
                                                                 : TaskbarProgressBarState.Error);

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

            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 || GitCommands.Settings.CloseProcessDialog))
            {
                Close();
            }
        }