Esempio n. 1
0
        public static XmlAttributeOverrides TryGetXmlAttributeOverrides()
        {
            PropertyInfo prop;
            Type         current = typeof(T);

            while ((prop = current.GetProperty("XmlOverrides")) == null && current.BaseType != typeof(Object))
            {
                current = current.BaseType;
            }
            XmlAttributeOverrides xOverrides = new XmlAttributeOverrides();

            if (prop != null)
            {
                foreach (XmlAttributeOverridesItem item in (IEnumerable <XmlAttributeOverridesItem>)prop.GetValue(null))
                {
                    xOverrides.ReplaceToDerived(item.OwnerType, item.XmlFieldName, item.FieldName, item.ReplacementType);
                }
            }
            return(xOverrides);
        }