예제 #1
0
        public static void Generate(
            TypeBuilder typeBuilder,
            PropertyMetadata propertyMetadata, 
            MethodBuilder getMethod,
            MethodBuilder setMethod)
        {
            var property = typeBuilder.DefineProperty(
                propertyMetadata.Name,
                propertyMetadata.PropertyAttributes,
                propertyMetadata.PropertyType,
                propertyMetadata.IndexerTypes);

            if (getMethod != null)
            {
                property.SetGetMethod(getMethod);
            }

            if (setMethod != null)
            {
                property.SetSetMethod(setMethod);
            }
        }
예제 #2
0
 public TypeMetadata(
     string name,
     Type baseType,
     Type[] interfaces,
      DispatcherFieldMetadata dispatcherField,
     FieldMetadata[] fields,
     ConstructorMetadata[] constructors, 
     MethodMetadata[] methods, 
     PropertyMetadata[] properties, 
     EventMetadata[] events, 
     TargetMetadata[] targets)
 {
     _name = name;
     _baseType = baseType;
     _interfaces = interfaces;
     _dispatcherField = dispatcherField;
     _fields = fields;
     _constructors = constructors;
     _methods = methods;
     _properties = properties;
     _events = events;
     _targets = targets;
 }