/// <summary> /// Checks if a reference is already added. The method parses all references and compares the the FinalItemSpec and the Guid. /// </summary> /// <returns>true if the assembly has already been added.</returns> protected override bool IsAlreadyAdded() { ReferenceContainerNode referencesFolder = this.ProjectMgr.FindChild(ReferenceContainerNode.ReferencesNodeVirtualName) as ReferenceContainerNode; Debug.Assert(referencesFolder != null, "Could not find the References node"); for (HierarchyNode n = referencesFolder.FirstChild; n != null; n = n.NextSibling) { if (n is ComReferenceNode) { ComReferenceNode refererenceNode = n as ComReferenceNode; // We check if the name and guids are the same if (refererenceNode.TypeGuid == this.TypeGuid && String.Compare(refererenceNode.Caption, this.Caption, StringComparison.OrdinalIgnoreCase) == 0) { return(true); } } } return(false); }
/// <summary> /// Creates a com reference node from a selector data. /// </summary> protected virtual ComReferenceNode CreateComReferenceNode(Microsoft.VisualStudio.Shell.Interop.VSCOMPONENTSELECTORDATA selectorData) { ComReferenceNode node = new ComReferenceNode(this.ProjectMgr, selectorData); return(node); }
/// <summary> /// Creates a com reference node from a selector data. /// </summary> protected virtual ComReferenceNode CreateComReferenceNode(Microsoft.VisualStudio.Shell.Interop.VSCOMPONENTSELECTORDATA selectorData) { ComReferenceNode node = new ComReferenceNode(this.ProjectMgr, selectorData); return node; }