예제 #1
0
        // Called by the scc manager when the provider is deactivated.
        // Hides and disable scc related menu commands
        public int SetInactive()
        {
            Trace.WriteLine(String.Format(CultureInfo.CurrentUICulture, "Git Source Control Provider set inactive"));
            _active = false;
            DisableSccForSolution();
            GlobalCommandHook hook = GlobalCommandHook.GetInstance(_sccProvider);

            hook.UnhookCommand(new CommandID(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.SLNREFRESH), HandleSolutionRefresh);
            return(VSConstants.S_OK);
        }
        public static GlobalCommandHook GetInstance(BasicSccProvider provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            if (_instance == null)
                _instance = new GlobalCommandHook(provider);

            return _instance;
        }
예제 #3
0
        public static GlobalCommandHook GetInstance(BasicSccProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (_instance == null)
            {
                _instance = new GlobalCommandHook(provider);
            }

            return(_instance);
        }
예제 #4
0
        // Called by the scc manager when the provider is activated.
        // Make visible and enable if necessary scc related menu commands
        public int SetActive()
        {
            Trace.WriteLine(String.Format(CultureInfo.CurrentUICulture, "EZ-GIT set active"));
            _active = true;
            GlobalCommandHook hook = GlobalCommandHook.GetInstance(_sccProvider);

            hook.HookCommand(new CommandID(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.SLNREFRESH), HandleSolutionRefresh);

            ThreadHelper.JoinableTaskFactory.Run(async delegate
            {
                await OpenTracker();
                await RefreshSolution();
            });
            //MarkDirty(false);
            return(VSConstants.S_OK);
        }