コード例 #1
0
ファイル: CommandState.cs プロジェクト: pangfd/AnkhSVN2019
        bool GetOtherSccActive()
        {
            EnsureContexts();

            try
            {
                foreach (SccData scc in _otherSccProviderContexts)
                {
                    if (scc.Active)
                    {
                        // Ok, let's ask the service if it has any files under source control?

                        Guid gService = new Guid(scc._service);

                        IVsSccProvider pv = GetService <IAnkhQueryService>().QueryService <IVsSccProvider>(gService);

                        int iManaging;
                        if (pv != null && VSErr.Succeeded(pv.AnyItemsUnderSourceControl(out iManaging)))
                        {
                            if (iManaging != 0)
                            {
                                return(true);
                            }
                        }
                        break;
                    }
                }
            }
            catch { }

            return(false);
        }
コード例 #2
0
        private void SetScciProviderInactive()
        {
            var getProvider = GetService(typeof(IVsRegisterScciProvider)) as IVsGetScciProviderInterface;

            if (getProvider != null)
            {
                IVsSccProvider provider = getProvider.GetProvider();
                if (provider != null && provider.GetType().Namespace == "Microsoft.TeamFoundation.Git.Provider")
                {
                    provider.SetInactive();
                }
            }
        }
コード例 #3
0
        public static IVsSccProvider GetProvider(this IVsGetScciProviderInterface getScciProvider)
        {
            IVsSccProvider provider = null;
            IntPtr         pUnk     = IntPtr.Zero;

            try
            {
                pUnk = getScciProvider.GetInterface(typeof(IVsSccProvider).GUID);
                if (pUnk != IntPtr.Zero)
                {
                    provider = Marshal.GetObjectForIUnknown(pUnk) as IVsSccProvider;
                }
            }
            finally
            {
                if (pUnk != IntPtr.Zero)
                {
                    Marshal.Release(pUnk);
                }
            }
            return(provider);
        }