CorCompare.TypeData.MustDocumentMethod C# (CSharp) Method

MustDocumentMethod() public static method

public static MustDocumentMethod ( Mono.Cecil.MethodDefinition method ) : bool
method Mono.Cecil.MethodDefinition
return bool
		public static bool MustDocumentMethod (MethodDefinition method) {
			// All other methods
			MethodAttributes maskedAccess = method.Attributes & MethodAttributes.MemberAccessMask;
			return maskedAccess == MethodAttributes.Public
				|| maskedAccess == MethodAttributes.Family
				|| maskedAccess == MethodAttributes.FamORAssem;
		}

Usage Example

Esempio 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();
        }