Example #1
0
        public override void OnEnd()
        {
            object     obj2   = Digester.Peek();
            object     root   = Digester.Root;
            MethodInfo method = root.GetType().GetMethod(_methodName, BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);

            if (method != null)
            {
                method.Invoke(root, new object[] { obj2 });
            }
        }
Example #2
0
        public override void OnEnd()
        {
            object obj2   = Digester.Pop();
            object obj3   = Digester.Peek();
            var    method = obj3.GetType().GetMethod(methodName, BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);

            if (method != null)
            {
                method.Invoke(obj3, new object[] { obj2 });
            }
            Digester.Push(obj2);
        }
Example #3
0
        public override void OnEnd()
        {
            string propertyName = this.propertyName;

            if (propertyName == null)
            {
                propertyName = Digester.ElementName;
            }
            object       obj2     = Digester.Peek();
            PropertyInfo property = obj2.GetType().GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance);

            if (property != null)
            {
                property.SetValue(obj2, TypeConverterUtility.ConvertTo(body, property.PropertyType), null);
            }
        }
Example #4
0
        public override void OnEnd()
        {
            string[] strArray = null;
            if (paramCount < 0)
            {
                strArray = new string[0];
            }
            else if (paramCount == 0)
            {
                strArray = new string[] { body };
                if (body == null)
                {
                    return;
                }
            }
            else if (paramCount > 0)
            {
                strArray = Digester.PopParameters();
                if ((paramCount == 1) && (strArray[0] == null))
                {
                    return;
                }
            }
            object     obj2   = Digester.Peek();
            MethodInfo method = null;

            if (paramTypes != null)
            {
                method = obj2.GetType().GetMethod(methodName, paramTypes);
            }
            else
            {
                method = obj2.GetType().GetMethod(methodName, new Type[0]);
            }
            if (method != null)
            {
                ParameterInfo[] parameters = method.GetParameters();
                object[]        objArray   = new object[strArray.Length];
                for (int i = 0; i < objArray.Length; i++)
                {
                    objArray[i] = TypeConverterUtility.ConvertTo(strArray[i], parameters[i].ParameterType);
                }
                method.Invoke(obj2, objArray);
                body = null;
            }
        }
Example #5
0
        public override void OnBegin()
        {
            string name = null;
            string str2 = null;

            for (int i = 0; i < Digester.Attributes.Count; i++)
            {
                string key  = Digester.Attributes.GetKey(i);
                string str3 = Digester.Attributes[i];
                if (key == _name)
                {
                    name = str3;
                }
                else if (key == _value)
                {
                    str2 = str3;
                }
            }
            object       obj2     = Digester.Peek();
            PropertyInfo property = obj2.GetType().GetProperty(name, BindingFlags.Public | BindingFlags.Instance);

            property.SetValue(obj2, TypeConverterUtility.ConvertTo(str2, property.PropertyType), null);
        }