Inheritance: GitExtensionsForm
Example #1
0
        public bool StartPushDialog(IWin32Window owner, bool pushOnShow)
        {
            if (!RequiresValidWorkingDir(owner))
            {
                return(false);
            }

            if (!InvokeEvent(owner, PrePush))
            {
                return(true);
            }

            using (var form = new FormPush())
            {
                if (pushOnShow)
                {
                    form.PushAndShowDialogWhenFailed(owner);
                }
                else
                {
                    form.ShowDialog(owner);
                }
            }

            InvokeEvent(owner, PostPush);

            return(true);
        }
Example #2
0
        public bool StartPushDialog(bool pushOnShow)
        {
            if (!RequiresValidWorkingDir())
            {
                return(false);
            }

            if (!InvokeEvent(PrePush))
            {
                return(true);
            }

            var form = new FormPush();

            if (pushOnShow)
            {
                form.PushAndShowDialogWhenFailed();
            }
            else
            {
                form.ShowDialog();
            }

            InvokeEvent(PostPush);

            return(true);
        }
Example #3
0
        public bool StartPushDialog(bool pushOnShow)
        {
            if (!InvokeEvent(PrePush))
            {
                return(true);
            }

            var form = new FormPush {
                PushOnShow = pushOnShow
            };

            form.ShowDialog();

            InvokeEvent(PostPush);

            return(true);
        }
        public bool StartPushDialog(bool pushOnShow)
        {
            if (!RequiresValidWorkingDir())
            {
                return(false);
            }

            if (!InvokeEvent(PrePush))
            {
                return(true);
            }

            var form = new FormPush {
                PushOnShow = pushOnShow
            };

            form.ShowDialog();

            InvokeEvent(PostPush);

            return(true);
        }
        public bool StartPushDialog(IWin32Window owner, bool pushOnShow)
        {
            if (!RequiresValidWorkingDir(owner))
                return false;

            if (!InvokeEvent(owner, PrePush))
                return true;

            using (var form = new FormPush(this))
            {
                if (pushOnShow)
                    form.PushAndShowDialogWhenFailed(owner);
                else
                    form.ShowDialog(owner);
            }

            InvokeEvent(owner, PostPush);

            return true;
        }
Example #6
0
        public bool StartPushDialog(bool pushOnShow)
        {
            if (!RequiresValidWorkingDir())
                return false;

            if (!InvokeEvent(PrePush))
                return true;

            var form = new FormPush();
            if (pushOnShow)
                form.PushAndShowDialogWhenFailed();
            else
                form.ShowDialog();

            InvokeEvent(PostPush);

            return true;
        }
Example #7
0
        public bool StartPushDialog(IWin32Window owner, bool pushOnShow, out bool pushCompleted)
        {
            pushCompleted = false;
            if (!RequiresValidWorkingDir(owner))
                return false;

            if (!InvokeEvent(owner, PrePush))
                return true;

            using (var form = new FormPush(this))
            {
                DialogResult dlgResult;
                if (pushOnShow)
                    dlgResult = form.PushAndShowDialogWhenFailed(owner);
                else
                    dlgResult = form.ShowDialog(owner);

                if (dlgResult == DialogResult.OK)
                    pushCompleted = !form.ErrorOccurred;
            }

            InvokeEvent(owner, PostPush);

            return true;
        }
        public bool StartPushDialog(bool pushOnShow)
        {
            if (!InvokeEvent(PrePush))
                return true;

            FormPush form = new FormPush();
            form.PushOnShow = pushOnShow;
            form.ShowDialog();

            InvokeEvent(PostPush);

            return true;
        }
        public bool StartPushDialog(bool pushOnShow)
        {
            if (!RequiresValidWorkingDir())
                return false;

            if (!InvokeEvent(PrePush))
                return true;

            var form = new FormPush { PushOnShow = pushOnShow };
            form.ShowDialog();

            InvokeEvent(PostPush);

            return true;
        }
Example #10
0
        void IContextMenu.InvokeCommand(IntPtr pici)
        {
            if (fileNames.Count == 1)
                if (Directory.Exists(fileNames[0]))
                    GitCommands.Settings.WorkingDir = fileNames[0];

            if (string.IsNullOrEmpty(GitCommands.Settings.WorkingDir) && fileNames.Count > 0)
                GitCommands.Settings.WorkingDir = fileNames[0].Substring(0, fileNames[0].LastIndexOf('\\'));

            if (string.IsNullOrEmpty(GitCommands.Settings.WorkingDir))
                GitCommands.Settings.WorkingDir = Directory.GetCurrentDirectory();

            try
            {
                Type typINVOKECOMMANDINFO = Type.GetType("ShellExt.INVOKECOMMANDINFO");
                INVOKECOMMANDINFO ici = (INVOKECOMMANDINFO)Marshal.PtrToStructure(pici, typINVOKECOMMANDINFO);
                switch (ici.verb-1)
                {
                    case 0://Add file
                        {
                            FormAddFiles form = new FormAddFiles();
                            form.Show();

                            break;
                        }
                    case 1://Branch
                        {
                            FormBranch form = new FormBranch();
                            form.Show();
                            break;
                        }
                    case 2://Browse
                        {
                            FormBrowse form = new FormBrowse();
                            form.Show();
                            break;
                        }
                    case 3://Checkout
                        {
                            FormCheckout form = new FormCheckout();
                            form.Show();
                            break;
                        }
                    case 4://Clone
                        {
                            FormClone form = new FormClone();
                            form.Show();
                            break;
                        }
                    case 5://Commit
                        {
                            FormCommit form = new FormCommit();
                            form.Show();
                            break;
                        }
                    case 6://Diff
                        {
                            FormDiff form = new FormDiff();
                            form.Show();
                            break;
                        }
                    case 7://Init
                        {
                            GitCommands.Init cmd = new GitCommands.Init(new GitCommands.InitDto());
                            cmd.Execute();
                            MessageBox.Show(cmd.Dto.Result);
                            break;
                        }
                    case 8://File history
                        {
                            if (fileNames.Count > 0)
                            {
                                FormFileHistory form = new FormFileHistory(fileNames[0]);
                                form.Show();
                            }
                            break;
                        }
                    case 9://ViewPatch
                        {
                            ViewPatch patchapply = new ViewPatch();
                            patchapply.Show();
                            break;
                        }
                    case 10://MergePatch
                        {
                            MergePatch form = new MergePatch();
                            form.Show();
                            break;
                        }
                    case 11://Push
                        {
                            FormPush form = new FormPush();
                            form.Show();
                            break;
                        }
                    case 12://Pull
                        {
                            FormPull form = new FormPull();
                            form.Show();
                            break;
                        }
                    case 13://Bash
                        {
                            GitCommands.GitCommands.RunBash();
                            break;
                        }
                    case 14://Gui
                        {
                            GitCommands.GitCommands.RunGui();
                            break;
                        }
                    default:
                        break;

                }

            }
            catch(Exception exe)
            {
                EventLog.WriteEntry("FileHashShell", exe.ToString());
            }

            //fileNames
        }