예제 #1
0
        public DomCecilType(TypeDefinition typeDefinition, bool loadInternal)
        {
            this.typeDefinition = typeDefinition;
            this.loadInternal   = loadInternal;
            this.classType      = GetClassType(typeDefinition);

            this.Name      = DomCecilType.RemoveGenericParamSuffix(typeDefinition.Name);
            this.Namespace = typeDefinition.Namespace;

            this.Modifiers = GetModifiers(typeDefinition.Attributes);

            if (typeDefinition.BaseType != null)
            {
                this.baseType = DomCecilMethod.GetReturnType(typeDefinition.BaseType);
            }
            DomCecilMethod.AddAttributes(this, typeDefinition.CustomAttributes);

            foreach (TypeReference interfaceReference in typeDefinition.Interfaces)
            {
                this.AddInterfaceImplementation(DomCecilMethod.GetReturnType(interfaceReference));
            }
            foreach (GenericParameter parameter in typeDefinition.GenericParameters)
            {
                TypeParameter tp = new TypeParameter(parameter.FullName);
                tp.Variance = (TypeParameterVariance)(((uint)parameter.Attributes) & 3);
                foreach (TypeReference tr in parameter.Constraints)
                {
                    tp.AddConstraint(DomCecilMethod.GetReturnType(tr));
                }
                AddTypeParameter(tp);
            }
        }
예제 #2
0
/*		FieldDefinition fieldDefinition;
 *
 *              public FieldDefinition FieldDefinition {
 *                      get {
 *                              return fieldDefinition;
 *                      }
 *              }
 */

        public DomCecilField(FieldDefinition fieldDefinition)
        {
            base.name       = fieldDefinition.Name;
            base.Modifiers  = DomCecilType.GetModifiers(fieldDefinition);
            base.ReturnType = DomCecilMethod.GetReturnType(fieldDefinition.FieldType);
            DomCecilMethod.AddAttributes(this, fieldDefinition.CustomAttributes);
        }
예제 #3
0
 public DomCecilEvent(EventDefinition eventDefinition)
 {
     this.eventDefinition = eventDefinition;
     base.name            = eventDefinition.Name;
     base.Modifiers       = DomCecilType.GetModifiers(eventDefinition.AddMethod);
     base.ReturnType      = DomCecilMethod.GetReturnType(eventDefinition.EventType);
     DomCecilMethod.AddAttributes(this, eventDefinition.CustomAttributes);
     if (!eventDefinition.IsSpecialName)
     {
         base.Modifiers &= ~MonoDevelop.Projects.Dom.Modifiers.SpecialName;
     }
 }