Inheritance: ResourceManager.GitExtensionsFormBase
Exemplo n.º 1
0
        public void Execute(GitUIBaseEventArgs gitUiCommands)
        {
            if (string.IsNullOrEmpty(gitUiCommands.GitWorkingDir))
            {
                return;
            }

            var formGitStatistics =
                new FormGitStatistics(Settings.GetSetting("Code files"))
            {
                DirectoriesToIgnore =
                    Settings.GetSetting("Directories to ignore (EndsWith)")
            };

            if (Settings.GetSetting("Ignore submodules (true/false)")
                .Equals("true", StringComparison.InvariantCultureIgnoreCase))
            {
                foreach (var submodule in gitUiCommands.GitCommands.GetSubmodules())
                {
                    formGitStatistics.DirectoriesToIgnore += ";";
                    formGitStatistics.DirectoriesToIgnore += gitUiCommands.GitWorkingDir + submodule.LocalPath;
                }
            }

            formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");
            formGitStatistics.WorkingDir          = new DirectoryInfo(gitUiCommands.GitWorkingDir);

            formGitStatistics.ShowDialog();
        }
        public bool Execute(GitUIBaseEventArgs gitUiCommands)
        {
            if (string.IsNullOrEmpty(gitUiCommands.GitWorkingDir))
                return false;

            using (var formGitStatistics =
                new FormGitStatistics(Settings.GetSetting("Code files"))
                    {
                        DirectoriesToIgnore =
                            Settings.GetSetting("Directories to ignore (EndsWith)")
                    })
            {

                if (Settings.GetSetting("Ignore submodules (true/false)")
                    .Equals("true", StringComparison.InvariantCultureIgnoreCase))
                {
                    foreach (var submodule in gitUiCommands.GitCommands.GetSubmodules())
                    {
                        formGitStatistics.DirectoriesToIgnore += ";";
                        formGitStatistics.DirectoriesToIgnore += gitUiCommands.GitWorkingDir + submodule.LocalPath;
                    }
                }

                formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");
                formGitStatistics.WorkingDir = new DirectoryInfo(gitUiCommands.GitWorkingDir);

                formGitStatistics.ShowDialog(gitUiCommands.OwnerForm as IWin32Window);
            }
            return false;
        }
Exemplo n.º 3
0
        public override bool Execute(GitUIBaseEventArgs gitUIEventArgs)
        {
            if (string.IsNullOrEmpty(gitUIEventArgs.GitModule.GitWorkingDir))
            {
                return(false);
            }

            using (var formGitStatistics =
                       new FormGitStatistics(gitUIEventArgs.GitModule, Settings.GetSetting("Code files"))
            {
                DirectoriesToIgnore =
                    Settings.GetSetting("Directories to ignore (EndsWith)")
            })
            {
                if (Settings.GetSetting("Ignore submodules (true/false)")
                    .Equals("true", StringComparison.InvariantCultureIgnoreCase))
                {
                    foreach (var submodule in gitUIEventArgs.GitModule.GetSubmodules())
                    {
                        formGitStatistics.DirectoriesToIgnore += ";";
                        formGitStatistics.DirectoriesToIgnore += gitUIEventArgs.GitModule.GitWorkingDir + submodule.LocalPath;
                    }
                }

                formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");
                formGitStatistics.WorkingDir          = new DirectoryInfo(gitUIEventArgs.GitModule.GitWorkingDir);

                formGitStatistics.ShowDialog(gitUIEventArgs.OwnerForm as IWin32Window);
            }
            return(false);
        }
        public override bool Execute(GitUIBaseEventArgs gitUIEventArgs)
        {
            if (string.IsNullOrEmpty(gitUIEventArgs.GitModule.WorkingDir))
                return false;

            using (var formGitStatistics =
                new FormGitStatistics(gitUIEventArgs.GitModule, CodeFiles[Settings])
                    {
                        DirectoriesToIgnore = IgnoreDirectories[Settings]
                    })
            {

                if (IgnoreSubmodules[Settings].Value)
                {
                    foreach (var submodule in gitUIEventArgs.GitModule.GetSubmodulesInfo())
                    {
                        formGitStatistics.DirectoriesToIgnore += ";";
                        formGitStatistics.DirectoriesToIgnore += Path.Combine(gitUIEventArgs.GitModule.WorkingDir, submodule.LocalPath);
                    }
                }

                formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");
                formGitStatistics.WorkingDir = new DirectoryInfo(gitUIEventArgs.GitModule.WorkingDir);

                formGitStatistics.ShowDialog(gitUIEventArgs.OwnerForm);
            }
            return false;
        }
Exemplo n.º 5
0
        public override bool Execute(GitUIBaseEventArgs gitUIEventArgs)
        {
            if (string.IsNullOrEmpty(gitUIEventArgs.GitModule.WorkingDir))
            {
                return(false);
            }

            using (var formGitStatistics =
                       new FormGitStatistics(gitUIEventArgs.GitModule, CodeFiles[Settings])
            {
                DirectoriesToIgnore = IgnoreDirectories[Settings]
            })
            {
                if (IgnoreSubmodules[Settings].Value)
                {
                    foreach (var submodule in gitUIEventArgs.GitModule.GetSubmodulesInfo())
                    {
                        formGitStatistics.DirectoriesToIgnore += ";";
                        formGitStatistics.DirectoriesToIgnore += Path.Combine(gitUIEventArgs.GitModule.WorkingDir, submodule.LocalPath);
                    }
                }

                formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");
                formGitStatistics.WorkingDir          = new DirectoryInfo(gitUIEventArgs.GitModule.WorkingDir);

                formGitStatistics.ShowDialog(gitUIEventArgs.OwnerForm);
            }
            return(false);
        }
        public override bool Execute(GitUIBaseEventArgs gitUIEventArgs)
        {
            if (string.IsNullOrEmpty(gitUIEventArgs.GitModule.WorkingDir))
                return false;
            bool countSubmodule = IgnoreSubmodules[Settings].HasValue && !IgnoreSubmodules[Settings].Value;
            using (var formGitStatistics =
                new FormGitStatistics(gitUIEventArgs.GitModule, CodeFiles[Settings], countSubmodule)
                    {
                        DirectoriesToIgnore = IgnoreDirectories[Settings]
                    })
            {
                formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");

                formGitStatistics.ShowDialog(gitUIEventArgs.OwnerForm);
            }
            return false;
        }
        public void Execute(IGitUIEventArgs gitUICommands)
        {
            try
            {
                if (!string.IsNullOrEmpty(gitUICommands.GitWorkingDir))
                {
                    FormGitStatistics formGitStatistics = new FormGitStatistics(gitUICommands);

                    formGitStatistics.CodeFilePattern = Settings.GetSetting("Code files");
                    formGitStatistics.WorkingDir = new DirectoryInfo(gitUICommands.GitWorkingDir);

                    formGitStatistics.ShowDialog();
                }
            }
            catch
            {
            }
        }
Exemplo n.º 8
0
        public override bool Execute(GitUIBaseEventArgs gitUIEventArgs)
        {
            if (string.IsNullOrEmpty(gitUIEventArgs.GitModule.WorkingDir))
            {
                return(false);
            }
            bool countSubmodule = !IgnoreSubmodules.ValueOrDefault(Settings);

            using (var formGitStatistics =
                       new FormGitStatistics(gitUIEventArgs.GitModule, CodeFiles.ValueOrDefault(Settings), countSubmodule)
            {
                DirectoriesToIgnore = IgnoreDirectories.ValueOrDefault(Settings)
            })
            {
                formGitStatistics.DirectoriesToIgnore = formGitStatistics.DirectoriesToIgnore.Replace("/", "\\");

                formGitStatistics.ShowDialog(gitUIEventArgs.OwnerForm);
            }
            return(false);
        }
        public override bool Execute(GitUIEventArgs args)
        {
            if (string.IsNullOrEmpty(args.GitModule.WorkingDir))
            {
                return(false);
            }

            var countSubmodule = !_ignoreSubmodules.ValueOrDefault(Settings);

            var formStatistics = new FormGitStatistics(args.GitModule, _codeFiles.ValueOrDefault(Settings), countSubmodule)
            {
                DirectoriesToIgnore = _ignoreDirectories.ValueOrDefault(Settings).Replace("/", "\\")
            };

            using (formStatistics)
            {
                formStatistics.ShowDialog(args.OwnerForm);
            }

            return(false);
        }