Ejemplo n.º 1
0
        public static TypeDom Build(TypeDoc doc, AssemblyDom asm, Func <MemberDom, bool> filterMembers)
        {
            var ret = new TypeDom
            {
                Assembly = asm,
                DocInfo  = doc.DocInfo,
                Type     = doc.ReflectionType,
            };

            MemberDom[] members = doc.Members
                                  .Where(_ => _.ReflectionMemberInfo != null)
                                  .Select(_ => MemberDom.Build(ret, _.ReflectionMemberInfo, _.DocInfo))
                                  .ToArray();

            members = members.Where(
                _ => (filterMembers == null || filterMembers(_)) && !_.IsPrivateOrInternal
                ).ToArray();

            ret.AllMembers   = members;
            ret.Constructors = members.OfType <ConstructorDom>().OrderBy(_ => _.ShortSignature).ToArray();
            ret.Fields       = members.OfType <FieldDom>()
                               .OrderBy(_ => _.ShortSignature)
                               .ToArray();
            ret.Properties = members.OfType <PropertyDom>()
                             .OrderBy(_ => _.ShortSignature)
                             .ToArray();
            ret.Methods = members.OfType <MethodDom>()
                          .Where(_ => !_.IsOperator)
                          .OrderBy(_ => _.ShortSignature)
                          .ToArray();
            ret.Operators = members.OfType <MethodDom>()
                            .Where(_ => _.IsOperator)
                            .OrderBy(_ => _.ShortSignature)
                            .ToArray();
            ret.Events = members.OfType <EventDom>()
                         .OrderBy(_ => _.ShortSignature)
                         .ToArray();
            ret.GenericTypeParameters = GenericParameterDom.BuildTypeGenericParameters(ret.Type, ret.DocInfo);
            return(ret);
        }
Ejemplo n.º 2
0
 public MethodDom(MethodInfo mi, XElement doc) : base(mi, doc)
 {
     _mi              = mi;
     Params           = ParameterDom.BuildParameters(mi.GetParameters(), doc);
     GenericArguments = GenericParameterDom.BuildMethodGenericParameters(_mi, doc);
 }