void LoadProjectFlagMap() { _projectFlagMapLoaded = true; IAnkhConfigurationService configService = GetService <IAnkhConfigurationService>(); if (configService == null) { return; } using (RegistryKey projectHandlingKey = configService.OpenVSInstanceKey("Extensions\\AnkhSVN\\ProjectHandling")) { if (projectHandlingKey == null) { return; } foreach (string typeValue in projectHandlingKey.GetSubKeyNames()) { if (typeValue.Length != 38) // No proper guid { continue; } try { using (RegistryKey projectTypeKey = projectHandlingKey.OpenSubKey(typeValue)) { object v = projectTypeKey.GetValue("flags"); if (!(v is int)) { continue; } Guid projectType = new Guid(typeValue); SccProjectFlags flags = (SccProjectFlags)(int)v; _projectFlagMap.Add(projectType, flags); } } catch { /* Parse Error */ } } } }
public SccProjectData(SccProjectMap context, IVsSccProject2 project) { ThreadHelper.ThrowIfNotOnUIThread(); if (context == null) { throw new ArgumentNullException("context"); } else if (project == null) { throw new ArgumentNullException("project"); } _context = context; _map = context; // Project references to speed up marshalling _sccProject = project; _hierarchy = (IVsHierarchy)project; // A project must be a hierarchy in VS _vsProject = (IVsProject)project; // A project must be a VS project _projectFlags = GetProjectFlags(ProjectTypeGuid); _files = new SccProjectFileCollection(); uint addvpFlags; IVsSolution sln = GetService <IVsSolution>(typeof(SVsSolution)); if (sln != null && VSErr.Succeeded(sln.GetVirtualProjectFlags(_hierarchy, out addvpFlags))) { if ((addvpFlags & (uint)__VSADDVPFLAGS.ADDVP_ExcludeFromSCC) != 0) { _projectFlags |= SccProjectFlags.ExcludedFromScc; } if ((addvpFlags & (uint)__VSADDVPFLAGS.ADDVP_AddToProjectWindow) == 0) { _projectFlags |= SccProjectFlags.DontAddToProjectWindow; } } }
public ProvideProjectTypeSettingsAttribute(string projectType, SccProjectFlags flags) { _projectType = new Guid(projectType); _flags = flags; }