예제 #1
0
        /// <summary>
        /// Refreshes the collection of reference datas within this <see cref="ReferenceLocator"/> from 
        /// a supplied collection of <see cref="ReferenceExtenderDefinition"/>.
        /// </summary>
        /// <param name="references">The source of new reference information.</param>
        /// <remarks>The reference datas collection for this <see cref="ReferenceLocator"/> will be 
        /// reset to a new <see cref="Hashtable"/> regardless of the contents of <paramref name="references"/>.</remarks>
        public void UpdateNodeReferences(ReferenceExtenderDefinition[] references)
        {
            this.referenceDatas = new Hashtable();
            ArrayList refParts;
            string hashKey = string.Empty;

            foreach (ReferenceExtenderDefinition reference in references)
            {
                refParts = new ArrayList(reference.ReferenceParts);

                int i = 1;
                hashKey = BuildHashtableReferenceKey(reference.ReferenceType) + " " + i.ToString();
                while (this.referenceDatas.ContainsKey(hashKey))
                {
                    i++;
                    hashKey = BuildHashtableReferenceKey(reference.ReferenceType) + " " + i.ToString();
                }

                this.referenceDatas[hashKey] = refParts;
            }
        }
예제 #2
0
        /// <summary>
        /// Adding new references to the element
        /// </summary>
        /// <param name="references"></param>
        public void UpdateReferences(ReferenceExtenderDefinition[] references)
        {
            if (this.referenceInfo == null)
            {
                referenceInfo = new ReferenceLocator();

            }
            referenceInfo.UpdateNodeReferences(references);
        }