Esempio n. 1
0
        /// <summary>
        ///     Creates a copy of the structure element in the designated dictionary. The namespace structure is copied over.
        ///     The new structure element is set to update this one.
        /// </summary>
        /// <param name="dictionary">The target dictionary of the copy</param>
        /// <returns></returns>
        public StructureElement CreateStructureElementUpdate(Dictionary dictionary)
        {
            StructureElement retVal = new StructureElement();

            retVal.Name     = Name;
            retVal.TypeName = TypeName;
            retVal.Comment  = Comment;
            retVal.setUpdates(Guid);

            String[] names = FullName.Split('.');
            names = names.Take(names.Count() - 1).ToArray();
            String[] nameSpaceRef = names.Take(names.Count() - 1).ToArray();

            NameSpace nameSpace = dictionary.GetNameSpaceUpdate(nameSpaceRef, Dictionary);
            Structure structure = nameSpace.GetStructureUpdate(names.Last(), (NameSpace)nameSpace.Updates);

            structure.appendElements(retVal);

            return(retVal);
        }