/// <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)); }
/// <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; }
/// <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); } }