public override void Build() { base.Build(); if (Type.HasGenericParameters) { _genericParameters = Type.GenericParameters.Select(p => new GenericParameterInfo(p, IsContextItemNullable(p))).ToList(); } foreach (var method in Type.Methods.Where(m => m.HasBody && !m.IsGetter && !m.IsSetter && !m.HasAnyGeneratedAttribute())) { var methodContext = new MethodContext(method, this); methodContext.Build(); _methodContexts.Add(methodContext); } foreach (var property in Type.Properties.Where(p => (p.GetMethod ?? p.SetMethod).HasBody && !p.HasAnyGeneratedAttribute())) { var propertyContext = new PropertyContext(property, this); propertyContext.Build(); if (propertyContext.GetMethodContext != null) { _methodContexts.Add(propertyContext.GetMethodContext); } if (propertyContext.SetMethodContext != null) { _methodContexts.Add(propertyContext.SetMethodContext); } } }
public MethodContext(MethodDefinition method, PropertyContext propertyContext) : base(method, propertyContext) { Method = method; TypeContext = propertyContext.TypeContext; }