public override InheritanceMappingAttribute[] GetInheritanceMapping(Type type, TypeExtension typeExtension) { var extList = typeExtension.Attributes["InheritanceMapping"]; if (extList == AttributeExtensionCollection.Null) { return(Array <InheritanceMappingAttribute> .Empty); } var attrs = new InheritanceMappingAttribute[extList.Count]; for (var i = 0; i < extList.Count; i++) { var ext = extList[i]; attrs[i] = new InheritanceMappingAttribute { Code = ext["Code"], IsDefault = TypeExtension.ToBoolean(ext["IsDefault", "False"], false), Type = Type.GetType(Convert.ToString(ext["Type"])) }; } return(attrs); }
public override InheritanceMappingAttribute[] GetInheritanceMapping(Type type, TypeExtension typeExtension) { var attrs = type.GetCustomAttributes(typeof(InheritanceMappingAttribute), true); if (attrs.Length > 0) { var maps = new InheritanceMappingAttribute[attrs.Length]; for (var i = 0; i < attrs.Length; i++) { maps[i] = (InheritanceMappingAttribute)attrs[i]; } return(maps); } return(base.GetInheritanceMapping(type, typeExtension)); }
public override InheritanceMappingAttribute[] GetInheritanceMapping(Type type, TypeExtension typeExtension) { var attrs = type.GetCustomAttributes(typeof(InheritanceMappingAttribute), true); if (attrs.Length > 0) { var maps = new InheritanceMappingAttribute[attrs.Length]; for (var i = 0; i < attrs.Length; i++) maps[i] = (InheritanceMappingAttribute)attrs[i]; return maps; } return base.GetInheritanceMapping(type, typeExtension); }
public override InheritanceMappingAttribute[] GetInheritanceMapping(Type type, TypeExtension typeExtension) { var extList = typeExtension.Attributes["InheritanceMapping"]; if (extList == AttributeExtensionCollection.Null) return Array<InheritanceMappingAttribute>.Empty; var attrs = new InheritanceMappingAttribute[extList.Count]; for (var i = 0; i < extList.Count; i++) { var ext = extList[i]; attrs[i] = new InheritanceMappingAttribute { Code = ext["Code"], IsDefault = TypeExtension.ToBoolean(ext["IsDefault", "False"], false), Type = Type.GetType(Convert.ToString(ext["Type"])) }; } return attrs; }