Exemplo n.º 1
0
        /// <summary>
        /// Removes a nested type.
        /// </summary>
        /// <param name="pType"></param>
        public bool RemoveNestedType(MetadataSetType pType)
        {
            if (pType == null)
            {
                return(false);
            }

            pType.ParentType = null;
            this.mNestedTypesByTarget.Remove(pType.mTargetType);
            return(this.mNestedTypes.Remove(pType.Id));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a nested type.
        /// </summary>
        /// <param name="pType"></param>
        public void AddNestedType(MetadataSetType pType)
        {
            if (pType == null)
            {
                return;
            }

            pType.ParentType            = this;
            this.mNestedTypes[pType.Id] = pType;
            this.mNestedTypesByTarget[pType.mTargetType] = pType;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the nested type by its target identifier.
        /// </summary>
        /// <param name="pIdentifier">The target identifier/name</param>
        /// <returns>The type if any, Null otherwise.</returns>
        public IMetadataSetType this[TargetKey pIdentifier]
        {
            get
            {
                MetadataSetType lNestedType = null;
                if (this.mNestedTypesByTarget.TryGetValue(pIdentifier, out lNestedType))
                {
                    return(lNestedType);
                }

                return(null);
            }
        }