protected PropertyDef(ClassStructOrModuleDef parent, string name, FullNamedExpression propertyType,
                              ParameterList parameters, bool isIndexer, Modifier modifiers)
            : base(parent, name, modifiers)
        {
            PropertyType = propertyType;
            IsIndexedProperty = isIndexer;

            this.parameters = parameters;
        }
        public MethodDef(ClassStructOrModuleDef parent, string name, FullNamedExpression returnType, ParameterList param,
                         Modifier modifiers)
            : base(parent, new MemberName(parent.MemberName, Separators.DoubleColon, name), modifiers)
        {
            ReturnType = returnType;
            Parameters = param;

            parent.AddMethod(this);
        }
 protected ConstructorDef(ClassStructOrModuleDef parent, string name, ParameterList param, Modifier modifiers)
     : base(parent, name, new SimpleName(null, "Void", null), param, modifiers)
 {
     if (IsShared)
     {
         IsConstructor = true;
     }
     else
     {
         IsTypeInitializer = true;
     }
 }
 protected ClassStructOrModuleDef(ClassStructOrModuleDef parent, string name, MemberName baseClass,
                                  MemberName[] inherits, Modifier modifiers)
     : base(parent, name, baseClass, inherits, modifiers)
 {
 }
 public static ConstructorDef CreateConstructor(ClassStructOrModuleDef parent, ParameterList parameters,
                                                Modifier modifiers)
 {
     return new ConstructorDef(parent, ".ctor", parameters, modifiers);
 }
 public static ConstructorDef CreateTypeInitializer(ClassStructOrModuleDef parent)
 {
     return new ConstructorDef(parent, ".cctor", new ParameterList(), Modifier.Private | Modifier.Shared);
 }
 public static PropertyDef CreateIndexedProperty(ClassStructOrModuleDef parent, string name,
                                                 FullNamedExpression propertyType, ParameterList parameters,
                                                 Modifier modifiers)
 {
     return new PropertyDef(parent, name, propertyType, parameters, true, modifiers);
 }
        public static PropertyDef CreateProperty(ClassStructOrModuleDef parent, string name,
                                                 FullNamedExpression propertyType, Parameter parameter,
                                                 Modifier modifiers)
        {
            var plist = new ParameterList();
            plist.Add(parameter);

            return new PropertyDef(parent, name, propertyType, plist, false, modifiers);
        }