/// <summary>
        /// Checks if a reference is already added. The method parses all references and compares the filename.
        /// </summary>
        /// <returns>true if the extension reference has already been added.</returns>
        protected override bool IsAlreadyAdded(out ReferenceNode existingNode)
        {
            ReferenceContainerNode referencesFolder = this.ProjectMgr.FindChild(ReferenceContainerNode.ReferencesNodeVirtualName) as ReferenceContainerNode;

            Debug.Assert(referencesFolder != null, "Could not find the References node");

            string thisName = Path.GetFileNameWithoutExtension(this.ItemNode.Item.Xml.Include);

            for (HierarchyNode n = referencesFolder.FirstChild; n != null; n = n.NextSibling)
            {
                WixExtensionReferenceNode otherReference = n as WixExtensionReferenceNode;
                if (otherReference != null)
                {
                    string otherName = Path.GetFileNameWithoutExtension(otherReference.Url);
                    if (String.Equals(thisName, otherName, StringComparison.OrdinalIgnoreCase))
                    {
                        existingNode = otherReference;
                        return(true);
                    }
                }
            }

            existingNode = null;
            return(false);
        }
        // =========================================================================================
        // Constructors
        // =========================================================================================

        /// <summary>
        /// Initializes a new instance of the <see cref="WixExtensionReferenceNodeProperties"/> class.
        /// </summary>
        /// <param name="node">The node that contains the properties to expose via the Property Browser.</param>
        public WixExtensionReferenceNodeProperties(WixExtensionReferenceNode node)
            : base(node)
        {
        }