Inheritance: IVsSccProvider, IVsSccManagerTooltip, IVsSolutionEvents, IVsSolutionEvents2, IVsSccGlyphs, IDisposable, IVsUpdateSolutionEvents2, IVsTrackProjectDocumentsEvents2
 public PendingChangesView(ToolWindowWithEditor <PendingChangesView> toolWindow)
 {
     InitializeComponent();
     this._toolWindow = toolWindow;
     this.service     = BasicSccProvider.GetServiceEx <SccProviderService>();
     SetDiffCodeHightlighter();
     VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged;
     CurrentTracker             = RepositoryManager.Instance.ActiveTracker;
     RepositoryManager.Instance.ActiveTrackerChanged += Instance_ActiveTrackerChanged;
 }
Beispiel #2
0
        public PendingChangesView(ToolWindowWithEditor <PendingChangesView> toolWindow)
        {
            InitializeComponent();
            this._toolWindow = toolWindow;
            this.service     = BasicSccProvider.GetServiceEx <SccProviderService>();
            SetDiffCodeHightlighter();
            VSColorTheme.ThemeChanged += VSColorTheme_ThemeChanged;
            CurrentTracker             = RepositoryManager.Instance.ActiveTracker;
            RepositoryManager.Instance.ActiveTrackerChanged += Instance_ActiveTrackerChanged;

            //Fix for bug #78  : Commit comment text field shouldn't allow formatting
            DataObject.AddPastingHandler(textBoxComments, new DataObjectPastingEventHandler(TextBoxPasting));
        }
        internal void Save()
        {
            GitSccOptions.Current.GitBashPath            = this.textBox1.Text;
            GitSccOptions.Current.GitExtensionPath       = this.textBox2.Text;
            GitSccOptions.Current.DifftoolPath           = this.textBox3.Text;
            GitSccOptions.Current.TortoiseGitPath        = this.textBox4.Text;
            GitSccOptions.Current.NotExpandGitExtensions = this.checkBox1.Checked;
            GitSccOptions.Current.NotExpandTortoiseGit   = this.checkBox2.Checked;
            GitSccOptions.Current.UseTGitIconSet         = this.checkBox3.Checked;
            GitSccOptions.Current.DisableAutoRefresh     = this.checkBox4.Checked;
            GitSccOptions.Current.SaveConfig();

            SccProviderService sccProviderService = (SccProviderService)GetService(typeof(SccProviderService));

            sccProviderService.Refresh();
        }
Beispiel #4
0
        protected override void Initialize()
        {
            base.Initialize();
            control = new HistoryView(this);

            // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
            // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
            // the object returned by the Content property.
            base.Content = control;

            OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            var cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdHistoryViewRefresh);
            var menu = new MenuCommand(new EventHandler(OnRefreshCommand), cmd);

            mcs.AddCommand(menu);

            sccProviderService = BasicSccProvider.GetServiceEx <SccProviderService>();
        }
Beispiel #5
0
        internal void Save()
        {
            GitBash.GitExePath =
                GitSccOptions.Current.GitBashPath        = this.textBox1.Text;
            GitSccOptions.Current.GitExtensionPath       = this.textBox2.Text;
            GitSccOptions.Current.DifftoolPath           = this.textBox3.Text;
            GitSccOptions.Current.TortoiseGitPath        = this.textBox4.Text;
            GitSccOptions.Current.NotExpandGitExtensions = this.checkBox1.Checked;
            GitSccOptions.Current.NotExpandTortoiseGit   = this.checkBox2.Checked;
            GitSccOptions.Current.UseTGitIconSet         = this.checkBox3.Checked;
            GitSccOptions.Current.DisableAutoRefresh     = this.checkBox4.Checked;
            GitSccOptions.Current.DisableAutoLoad        = this.checkBox5.Checked;
            GitSccOptions.Current.NotUseUTF8FileNames    = this.checkBox6.Checked;
            GitSccOptions.Current.DisableDiffMargin      = this.chkDisableDiffMargin.Checked;
            GitSccOptions.Current.UseVsDiff = this.useVsDiffChk.Checked;

            GitBash.UseUTF8FileNames = !GitSccOptions.Current.NotUseUTF8FileNames;
            GitSccOptions.Current.SaveConfig();

            SccProviderService sccProviderService = (SccProviderService)GetService(typeof(SccProviderService));

            sccProviderService.MarkDirty(false);
        }
Beispiel #6
0
        internal void Save()
        {
            GitBash.GitExePath =
                GitSccOptions.Current.GitBashPath        = this.textBox1.Text;
            GitSccOptions.Current.GitExtensionPath       = this.textBox2.Text;
            GitSccOptions.Current.DifftoolPath           = this.textBox3.Text;
            GitSccOptions.Current.TortoiseGitPath        = this.textBox4.Text;
            GitSccOptions.Current.NotExpandGitExtensions = this.checkBox1.Checked;
            GitSccOptions.Current.NotExpandTortoiseGit   = this.checkBox2.Checked;
            GitSccOptions.Current.UseTGitIconSet         = this.checkBox3.Checked;
            GitSccOptions.Current.DisableAutoRefresh     = true;
            GitSccOptions.Current.DisableAutoLoad        = this.checkBox5.Checked;
            GitSccOptions.Current.TrackActiveGitRepo     = _cbrepoTrack.Checked;
            GitSccOptions.Current.NotUseUTF8FileNames    = this.checkBox6.Checked;
            GitSccOptions.Current.DisableDiffMargin      = true;
            GitSccOptions.Current.UseVsDiff = false;
            GitSccOptions.Current.DiffTool  = GetDiffToolId(); // this.cbDiffTool.SelectedItem.

            GitBash.UseUTF8FileNames = !GitSccOptions.Current.NotUseUTF8FileNames;
            GitSccOptions.Current.SaveConfig();

            SccProviderService sccProviderService = (SccProviderService)GetService(typeof(SccProviderService));
            //sccProviderService.MarkDirty(false);
        }
Beispiel #7
0
 public DisableRefreshHandle(SccProviderService service)
 {
     _service = service;
     Interlocked.Increment(ref _service._disableRefresh);
 }
        protected override void Initialize()
        {
            base.Initialize();
            control = new PendingChangesView(this);

            // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
            // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
            // the object returned by the Content property.
            base.Content = control;

            OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            var cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdPendingChangesCommit);
            var menu = new MenuCommand(new EventHandler(OnCommitCommand), cmd);
            mcs.AddCommand(menu);

            cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdPendingChangesAmend);
            menu = new MenuCommand(new EventHandler(OnAmendCommitCommand), cmd);
            mcs.AddCommand(menu);

            cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdPendingChangesRefresh);
            menu = new MenuCommand(new EventHandler(OnRefreshCommand), cmd);
            mcs.AddCommand(menu);

            sccProviderService = BasicSccProvider.GetServiceEx<SccProviderService>();
        }
        protected override void Initialize()
        {
            Trace.WriteLine(String.Format(CultureInfo.CurrentUICulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            projects = new List<GitFileStatusTracker>();
            sccService = new SccProviderService(this, projects);

            ((IServiceContainer)this).AddService(typeof(SccProviderService), sccService, true);

            // Add our command handlers for menu (commands must exist in the .vsct file)
            MsVsShell.OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as MsVsShell.OleMenuCommandService;
            if (mcs != null)
            {
                CommandID cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandRefresh);
                var menu = new MenuCommand(new EventHandler(OnRefreshCommand), cmd);
                mcs.AddCommand(menu);

                cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandGitBash);
                menu = new MenuCommand(new EventHandler(OnGitBashCommand), cmd);
                mcs.AddCommand(menu);

                cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandGitExtension);
                menu = new MenuCommand(new EventHandler(OnGitExtensionCommand), cmd);
                mcs.AddCommand(menu);

                cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandCompare);
                menu = new MenuCommand(new EventHandler(OnCompareCommand), cmd);
                mcs.AddCommand(menu);

                cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandUndo);
                menu = new MenuCommand(new EventHandler(OnUndoCommand), cmd);
                mcs.AddCommand(menu);

                cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandInit);
                menu = new MenuCommand(new EventHandler(OnInitCommand), cmd);
                mcs.AddCommand(menu);

                cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandGitTortoise);
                menu = new MenuCommand(new EventHandler(OnTortoiseGitCommand), cmd);
                mcs.AddCommand(menu);

                for (int i = 0; i < GitToolCommands.GitExtCommands.Count; i++)
                {
                    cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdGitExtCommand1 + i);
                    var mc = new MenuCommand(new EventHandler(OnGitExtCommandExec), cmd);
                    mcs.AddCommand(mc);
                }

                for (int i = 0; i < GitToolCommands.GitTorCommands.Count; i++)
                {
                    cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdGitTorCommand1 + i);
                    var mc = new MenuCommand(new EventHandler(OnGitTorCommandExec), cmd);
                    mcs.AddCommand(mc);
                }
            }

            // Register the provider with the source control manager
            // If the package is to become active, this will also callback on OnActiveStateChange and the menu commands will be enabled
            IVsRegisterScciProvider rscp = (IVsRegisterScciProvider)GetService(typeof(IVsRegisterScciProvider));
            rscp.RegisterSourceControlProvider(GuidList.guidSccProvider);

            _OnIdleEvent.RegisterForIdleTimeCallbacks(GetGlobalService(typeof(SOleComponentManager)) as IOleComponentManager);
            _OnIdleEvent.OnIdleEvent += new OnIdleEvent(sccService.UpdateNodesGlyphs);
        }
Beispiel #10
0
 public override void OnToolWindowCreated()
 {
     sccProviderService = BasicSccProvider.GetServiceEx <SccProviderService>();
     Refresh(sccProviderService.CurrentTracker); // refresh when the tool window becomes visible
 }
        /////////////////////////////////////////////////////////////////////////////
        // BasicSccProvider Package Implementation
        #region Package Members

        protected override void Initialize()
        {
            Trace.WriteLine(String.Format(CultureInfo.CurrentUICulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            projects   = new List <GitFileStatusTracker>();
            sccService = new SccProviderService(this, projects);

            ((IServiceContainer)this).AddService(typeof(SccProviderService), sccService, true);

            Blinkbox.Events.BlinkboxSccHooks.TriggerOnPackageInitialise(this, new Blinkbox.Events.OnPackageInitialiseArgs()
            {
                PackageInstance = this, SccService = this.sccService
            });

            // Add our command handlers for menu (commands must exist in the .vsct file)
            MsVsShell.OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as MsVsShell.OleMenuCommandService;
            if (mcs != null)
            {
                CommandID cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandRefresh);
                var       menu = new MenuCommand(new EventHandler(OnRefreshCommand), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandGitBash);
                menu = new MenuCommand(new EventHandler(OnGitBashCommand), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandGitExtension);
                menu = new MenuCommand(new EventHandler(OnGitExtensionCommand), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandCompare);
                menu = new MenuCommand(new EventHandler(OnCompareCommand), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandUndo);
                menu = new MenuCommand(new EventHandler(OnUndoCommand), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandInit);
                menu = new MenuCommand(new EventHandler(OnInitCommand), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandEditIgnore);
                menu = new MenuCommand(new EventHandler(OnEditIgnore), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandGitTortoise);
                menu = new MenuCommand(new EventHandler(OnTortoiseGitCommand), cmd);

                mcs.AddCommand(menu);
                for (int i = 0; i < GitToolCommands.GitExtCommands.Count; i++)
                {
                    cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdGitExtCommand1 + i);
                    var mc = new MenuCommand(new EventHandler(OnGitExtCommandExec), cmd);
                    mcs.AddCommand(mc);
                }

                for (int i = 0; i < GitToolCommands.GitTorCommands.Count; i++)
                {
                    cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdGitTorCommand1 + i);
                    var mc = new MenuCommand(new EventHandler(OnGitTorCommandExec), cmd);
                    mcs.AddCommand(mc);
                }

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandPendingChanges);
                menu = new MenuCommand(new EventHandler(ShowPendingChangesWindow), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandHistory);
                menu = new MenuCommand(new EventHandler(ShowHistoryWindow), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdPendingChangesCommitToBranch);
                menu = new MenuCommand(new EventHandler(OnSwitchBranchCommand), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdPendingChangesCommit);
                menu = new MenuCommand(new EventHandler(OnCommitCommand), cmd);
                mcs.AddCommand(menu);

                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdPendingChangesAmend);
                menu = new MenuCommand(new EventHandler(OnAmendCommitCommand), cmd);
                mcs.AddCommand(menu);


                cmd  = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandAbout);
                menu = new MenuCommand(new EventHandler(OnAbout), cmd);
                mcs.AddCommand(menu);

                Blinkbox.Events.BlinkboxSccHooks.TriggerRegisterCommands(this, new Blinkbox.Events.OnRegisterCommandsArgs()
                {
                    MenuService = mcs
                });
            }


            // Register the provider with the source control manager
            // If the package is to become active, this will also callback on OnActiveStateChange and the menu commands will be enabled
            IVsRegisterScciProvider rscp = (IVsRegisterScciProvider)GetService(typeof(IVsRegisterScciProvider));

            rscp.RegisterSourceControlProvider(GuidList.guidSccProvider);

            _OnIdleEvent.RegisterForIdleTimeCallbacks(GetGlobalService(typeof(SOleComponentManager)) as IOleComponentManager);
            _OnIdleEvent.OnIdleEvent += new OnIdleEvent(sccService.UpdateNodesGlyphs);
        }
 public PendingChangesView(ToolWindowWithEditor <PendingChangesView> toolWindow)
 {
     InitializeComponent();
     this.toolWindow = toolWindow;
     this.service    = BasicSccProvider.GetServiceEx <SccProviderService>();
 }
 public PendingChangesView()
 {
     InitializeComponent();
     this.service    = BasicSccProvider.GetServiceEx <SccProviderService>();
     currentInstance = this;
 }
 public override void OnToolWindowCreated()
 {
     sccProviderService = BasicSccProvider.GetServiceEx<SccProviderService>();
     Refresh(sccProviderService.CurrentTracker, true); // refresh when the tool window becomes visible
 }
 public DisableRefreshHandle(SccProviderService service)
 {
     _service = service;
     Interlocked.Increment(ref _service._disableRefresh);
 }