예제 #1
0
        protected bool AddCultureIfRequired(XmlBehaviorAttribute beh)
        {
            bool   ret = false;
            string c   = beh.Culture;

            if (string.IsNullOrEmpty(c) == false)
            {
                cultureStack.Push(c);
                ret = true;
            }
            return(ret);
        }
예제 #2
0
        private string GetAttributeName(string p, XmlBehaviorAttribute behavior)
        {
            string ret;

            if (behavior.XmlMapping != null)
            {
                ret = behavior.XmlMapping;
            }
            else
            {
                ret = char.ToLower(p[0]) + p.Substring(1);
            }

            return(ret);
        }
예제 #3
0
        public static XmlBehaviorAttribute GetXmlBehavior(this System.Reflection.PropertyInfo property)
        {
            var attrs = property.GetCustomAttributes(false);
            XmlBehaviorAttribute ret = (XmlBehaviorAttribute)
                                       attrs.FirstOrDefault(i => i is XmlBehaviorAttribute);

            if (ret == null)
            {
                ret = new XmlBehaviorAttribute();
            }
            else
            {
                ret.DoValidityTest();
            }

            return(ret);
        }
예제 #4
0
        protected XmlBehaviorAttribute GetXmlBehaviorOf(PropertyInfo item)
        {
            XmlBehaviorAttribute ret = item.GetXmlBehavior();

            return(ret);
        }