Inheritance: ReferenceNode
Exemplo n.º 1
0
        /// <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 internal override bool IsAlreadyAdded(out ReferenceNode existingReference)
        {
            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)
            {
                ComReferenceNode referenceNode = n as ComReferenceNode;

                if (referenceNode != null)
                {
                    // We check if the name and guids are the same
                    if (referenceNode.TypeGuid == this.TypeGuid &&
                        referenceNode.WrapperTool == this.WrapperTool &&
                        referenceNode.MajorVersionNumber == this.MajorVersionNumber &&
                        referenceNode.MinorVersionNumber == this.MinorVersionNumber)
                    {
                        existingReference = referenceNode;
                        return(true);
                    }
                }
            }

            existingReference = null;
            return(false);
        }
Exemplo n.º 2
0
        /// <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)
            {
                ComReferenceNode refererenceNode = n as ComReferenceNode;

                if (refererenceNode != null)
                {
                    // 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);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Checks if a reference is already added. The method parses all references and compares the FinalItemSpec and the GUID.
        /// </summary>
        /// <returns>true if the assembly has already been added.</returns>
        public override bool IsAlreadyAdded(out ReferenceNode existingEquivalentNode)
        {
            ReferenceContainerNode referencesFolder = this.ProjectManager.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)
            {
                ComReferenceNode referenceNode = n as ComReferenceNode;

                if (referenceNode != null)
                {
                    // We check if the name and GUIDs are the same
                    if (referenceNode.TypeGuid == this.TypeGuid && String.Equals(referenceNode.Caption, this.Caption, StringComparison.OrdinalIgnoreCase))
                    {
                        existingEquivalentNode = referenceNode;
                        return(true);
                    }
                }
            }

            existingEquivalentNode = null;
            return(false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates a com reference node from a selector data.
        /// </summary>
        protected virtual ComReferenceNode CreateComReferenceNode(Microsoft.VisualStudio.Shell.Interop.VSCOMPONENTSELECTORDATA selectorData, string wrapperTool)
        {
            ComReferenceNode node = new ComReferenceNode(this.ProjectManager, selectorData);

            return(node);
        }
Exemplo n.º 5
0
 public ComReferenceProperties(ComReferenceNode node)
     : base(node)
 {
 }
 /// <summary>
 /// Creates a com reference node from a selector data.
 /// </summary>
 protected virtual ComReferenceNode CreateComReferenceNode(Microsoft.VisualStudio.Shell.Interop.VSCOMPONENTSELECTORDATA selectorData, string wrapperTool = null)
 {
     ComReferenceNode node = new ComReferenceNode(this.ProjectMgr, selectorData);
     return node;
 }
 public ComReferenceProperties(ComReferenceNode node)
     : base(node)
 {
 }