public override bool Equals(object obj) { PropertyPageInfo p = obj as PropertyPageInfo; if (p == null) { return(false); } // watch out for recursion -- just check ToolName and VsRoot if (tool.ToolName != p.tool.ToolName) { return(false); } if (tool.VsRoot != p.tool.VsRoot) { return(false); } if (clsid != p.clsid) { return(false); } if (pageid != p.pageid) { return(false); } if (category != p.category) { return(false); } if (projects.Count != p.projects.Count) { return(false); } for (int i = 0; i < projects.Count; i++) { if (projects[i] != p.projects[i]) { return(false); } } return(true); }
private static CodeToolInfo CodeToolsInfoFromRegistry(string vsRoot, string toolName, RegistryKey toolKey) { int refreshDelay = defaultRefreshDelay; try { refreshDelay = (int)toolKey.GetValue("RefreshDelay", defaultRefreshDelay); } catch { } string displayName = toolKey.GetValue("DisplayName", toolName) as string; CodeToolInfo tool = new CodeToolInfo(vsRoot, toolName, displayName, refreshDelay); RegistryKey propPagesKey = toolKey.OpenSubKey("PropertyPages", false); if (propPagesKey != null) { foreach (string propPage in propPagesKey.GetSubKeyNames()) { PropertyPageInfo pageInfo = PropertyPageInfo.PropertyPageInfoFromRegistry(tool, propPagesKey, propPage); if (pageInfo != null) { tool.propertyPages.Add(pageInfo); } } } RegistryKey targetsKey = toolKey.OpenSubKey("CommonTargets", false); if (targetsKey != null) { foreach (string target in targetsKey.GetSubKeyNames()) { RegistryKey targetKey = targetsKey.OpenSubKey(target, false); if (targetKey != null) { TargetInfo targetInfo = TargetInfo.ReadFromRegistry(tool, targetKey, target); if (targetInfo != null) { tool.targets.Add(targetInfo); } } } } return(tool); }