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); }
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(); } } }
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); }