示例#1
0
        protected override void AddExtraData(XmlNode p, MemberInfo member)
        {
            base.AddExtraData (p, member);
            PropertyInfo prop = (PropertyInfo) member;
            Type t = prop.PropertyType;
            AddAttribute (p, "ptype", prop.PropertyType.ToString ());
            MethodInfo _get = prop.GetGetMethod (true);
            MethodInfo _set = prop.GetSetMethod (true);
            bool haveGet = (_get != null && TypeData.MustDocumentMethod(_get));
            bool haveSet = (_set != null && TypeData.MustDocumentMethod(_set));
            MethodInfo [] methods;

            if (haveGet && haveSet) {
                methods = new MethodInfo [] {_get, _set};
            } else if (haveGet) {
                methods = new MethodInfo [] {_get};
            } else if (haveSet) {
                methods = new MethodInfo [] {_set};
            } else {
                //odd
                return;
            }

            string parms = Parameters.GetSignature (methods [0].GetParameters ());
            AddAttribute (p, "params", parms);

            MethodData data = new MethodData (document, p, methods);
            //data.NoMemberAttributes = true;
            data.DoOutput ();
        }
示例#2
0
		protected override void AddExtraData (XmlNode p, MemberInfo member)
		{
			base.AddExtraData (p, member);
			EventInfo evt = (EventInfo) member;
			AddAttribute (p, "eventtype", evt.EventHandlerType.ToString ());

			MethodInfo _add = evt.GetAddMethod (true);
			MethodInfo _remove = evt.GetRemoveMethod (true);
			bool haveAdd = (_add != null && TypeData.MustDocumentMethod (_add, true));
			bool haveRemove = (_remove != null && TypeData.MustDocumentMethod (_remove, true));
			MethodInfo [] methods;

			if (haveAdd && haveRemove) {
				methods = new MethodInfo [] { _add, _remove };
			} else if (haveAdd) {
				methods = new MethodInfo [] { _add };
			} else if (haveRemove) {
				methods = new MethodInfo [] { _remove };
			} else {
				return;
			}

			MethodData data = new MethodData (document, p, methods);
			data.DoOutput ();
		}