MustDocumentMethod() public static method

public static MustDocumentMethod ( Mono.Cecil.MethodDefinition method ) : bool
method Mono.Cecil.MethodDefinition
return bool
Exemplo n.º 1
0
        protected override void AddExtraData(XmlNode p, MemberReference memberDefenition)
        {
            base.AddExtraData(p, memberDefenition);
            PropertyDefinition prop = (PropertyDefinition)memberDefenition;

            AddAttribute(p, "ptype", Utils.CleanupTypeName(prop.PropertyType));
            MethodDefinition _get    = prop.GetMethod;
            MethodDefinition _set    = prop.SetMethod;
            bool             haveGet = (_get != null && TypeData.MustDocumentMethod(_get));
            bool             haveSet = (_set != null && TypeData.MustDocumentMethod(_set));

            MethodDefinition [] methods;

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

            string parms = Parameters.GetSignature(methods [0].Parameters);

            if (!string.IsNullOrEmpty(parms))
            {
                AddAttribute(p, "params", parms);
            }

            MethodData data = new MethodData(document, p, methods);

            //data.NoMemberAttributes = true;
            data.DoOutput();
        }