コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
		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);
		}
コード例 #4
0
		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;
		}