Beispiel #1
0
        static private bool integrateInGitExtensions()
        {
            string scriptPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);

            try
            {
                GitExtensionsIntegrationHelper.AddCustomActions(scriptPath);
            }
            catch (GitExtensionsIntegrationHelperException ex)
            {
                ExceptionHandlers.Handle("Cannot integrate mrHelper in Git Extensions", ex);
                return(false);
            }
            return(true);
        }
        private void initializeGitUILinks()
        {
            var  storageType           = ConfigurationHelper.GetPreferredStorageType(Program.Settings);
            bool isGitRepositoryUsed   = storageType == StorageSupport.LocalCommitStorageType.FullGitRepository;
            bool isRepositoryAvailable = isGitRepositoryUsed && !String.IsNullOrEmpty(_repositoryPath);

            linkLabelOpenGitExtensions.Visible = isRepositoryAvailable && GitExtensionsIntegrationHelper.IsInstalled();
            linkLabelOpenSourceTree.Visible    = isRepositoryAvailable && SourceTreeIntegrationHelper.IsInstalled();
            linkLabelOpenExplorer.Visible      = isRepositoryAvailable;

            traceInformation(String.Format(
                                 "GitUI link label visibility: Git Extensions: {0}, Source Tree: {1}, Explorer: {2}",
                                 linkLabelOpenGitExtensions.Visible.ToString(),
                                 linkLabelOpenSourceTree.Visible.ToString(),
                                 linkLabelOpenExplorer.Visible.ToString()));
        }
Beispiel #3
0
        static private void integrateInGitUI()
        {
            string scriptPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);

            try
            {
                GitExtensionsIntegrationHelper.AddCustomActions(scriptPath);
                SourceTreeIntegrationHelper.AddCustomActions(scriptPath);
            }
            catch (GitExtensionsIntegrationHelperException ex)
            {
                ExceptionHandlers.Handle("Cannot integrate mrHelper in Git Extensions", ex);
            }
            catch (SourceTreeIntegrationHelperException ex)
            {
                ExceptionHandlers.Handle("Cannot integrate mrHelper in Source Tree", ex);
            }
        }
 private void linkLabelOpenGitExtensions_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     traceInformation(String.Format("Launch Git Extensions for {0}", _repositoryPath));
     GitExtensionsIntegrationHelper.Browse(_repositoryPath);
 }