Esempio n. 1
0
        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 override void Build()
        {
            base.Build();

            if (Property.GetMethod != null)
            {
                GetMethodContext = new MethodContext(Property.GetMethod, this);
                GetMethodContext.Build();
            }

            if (Property.SetMethod != null)
            {
                SetMethodContext = new MethodContext(Property.SetMethod, this);
                SetMethodContext.Build();
            }
        }