Beispiel #1
0
        protected TypeSpec
        (
            IClrTypeName Name,
            CodeDocumentationSpec Documentation,
            ClrAccessKind AccessLevel,
            IEnumerable <AttributionSpec> Attributions,
            IEnumerable <TypeParameter> TypeParameters,
            IEnumerable <ClrTypeClosure> BaseTypes,
            IEnumerable <ClrInterfaceName> ImplicitRealizations,
            IClrElementName DeclaringType,
            bool IsStatic,
            IEnumerable <IClrMemberSpec> Members,
            bool IsPartial = false
        )
            : base(Name, Documentation, AccessLevel, Attributions)
        {
            this.Members              = rovalues(Members);
            this.BaseTypes            = rovalues(BaseTypes);
            this.ImplicitRealizations = rovalues(ImplicitRealizations);
            this.TypeParameters       = rovalues(TypeParameters);
            this.DeclaringType        = DeclaringType != null?some(DeclaringType) : none <IClrElementName>();

            this.IsStatic  = IsStatic;
            this.IsPartial = IsPartial;
        }
Beispiel #2
0
 public UsingSpec(IClrElementName SubjectName, string AliasName, bool IsStatic, CodeDocumentationSpec Documentation)
 {
     this.SubjectName   = SubjectName;
     this.IsStatic      = IsStatic;
     this.Documentation = Documentation;
     this.AliasName     = AliasName;
 }
Beispiel #3
0
 public DelegateSpec
 (
     ClrDelegateName Name,
     ClrAccessKind AccessLevel,
     IClrElementName ReturnTypeName,
     CodeDocumentationSpec Documentation        = null,
     IEnumerable <AttributionSpec> Attributions = null,
     IEnumerable <TypeParameter> TypeParameters = null,
     IClrElementName DeclaringType = null,
     params MethodParameterSpec[] Parameters
 )
     : base
     (
         Name,
         Documentation,
         AccessLevel,
         Attributions ?? array <AttributionSpec>(),
         TypeParameters ?? array <TypeParameter>(),
         array <ClrTypeClosure>(),
         array <ClrInterfaceName>(),
         DeclaringType,
         false,
         array <IClrMemberSpec>()
     )
 {
     this.ReturnTypeName   = ReturnTypeName;
     this.MethodParameters = rovalues(Parameters);
 }
Beispiel #4
0
 public InterfaceSpec
 (
     ClrInterfaceName Name,
     CodeDocumentationSpec Documentation        = null,
     ClrAccessKind?AccessLevel                  = null,
     IEnumerable <AttributionSpec> Attributions = null,
     IEnumerable <TypeParameter> TypeParameters = null,
     IEnumerable <ClrTypeClosure> BaseTypes     = null,
     IClrElementName DeclaringType              = null,
     bool IsPartial = false,
     IEnumerable <IClrMemberSpec> Members = null
 )
     : base
     (
         Name: Name,
         Documentation: Documentation,
         AccessLevel: AccessLevel ?? ClrAccessKind.Public,
         Attributions: Attributions ?? array <AttributionSpec>(),
         TypeParameters: TypeParameters ?? array <TypeParameter>(),
         BaseTypes: BaseTypes ?? array <ClrTypeClosure>(),
         ImplicitRealizations: array <ClrInterfaceName>(),
         DeclaringType: DeclaringType,
         IsStatic: false,
         Members: Members,
         IsPartial: IsPartial
     )
 {
 }
Beispiel #5
0
 public StructSpec
 (
     ClrStructName Name,
     CodeDocumentationSpec Documentation                 = null,
     ClrAccessKind?AccessLevel                           = null,
     IEnumerable <AttributionSpec> Attributions          = null,
     IEnumerable <TypeParameter> TypeParameters          = null,
     IEnumerable <ClrTypeClosure> BaseTypes              = null,
     IEnumerable <ClrInterfaceName> ImplicitRealizations = null,
     IClrElementName DeclaringType                       = null,
     bool IsPartial = false,
     params IClrMemberSpec[] Members
 )
     : base
     (
         Name,
         Documentation,
         AccessLevel ?? ClrAccessKind.Public,
         Attributions ?? array <AttributionSpec>(),
         TypeParameters ?? array <TypeParameter>(),
         BaseTypes ?? array <ClrTypeClosure>(),
         ImplicitRealizations ?? array <ClrInterfaceName>(),
         DeclaringType,
         false,
         Members,
         IsPartial: IsPartial
     )
 {
 }
Beispiel #6
0
 public MemberOperatorSpec
 (
     IClrElementName DeclaringTypeName,
     ClrAccessKind?AccessLevel                          = null,
     MethodBodySpec Body                                = null,
     CodeDocumentationSpec Documentation                = null,
     ClrCustomMemberIdentifier CustomMember             = null,
     IEnumerable <MethodParameterSpec> MethodParameters = null,
     IEnumerable <AttributionSpec> Attributions         = null
 )
     : base(
         DeclaringTypeName: DeclaringTypeName,
         Name: new ClrMemberOperatorName(DeclaringTypeName.SimpleName),
         AccessLevel: AccessLevel ?? ClrAccessKind.Public,
         IsStatic: true,
         IsExtension: false,
         IsAbstract: false,
         IsVirtual: false,
         IsOverride: false,
         IsSealed: false,
         IsPartial: false,
         Body: Body,
         Documentation: Documentation,
         CustomMemberKind: CustomMember,
         MethodParameters: MethodParameters,
         Attributions: Attributions)
 {
 }
Beispiel #7
0
 public MethodSpec
 (
     IClrElementName DeclaringTypeName,
     N Name,
     ClrTypeReference ReturnType = null,
     ClrAccessKind?AccessLevel   = null,
     bool IsStatic       = false,
     bool IsExtension    = false,
     bool IsAbstract     = false,
     bool IsVirtual      = false,
     bool IsOverride     = false,
     bool IsSealed       = false,
     bool IsPartial      = false,
     MethodBodySpec Body = null,
     CodeDocumentationSpec Documentation                = null,
     ClrCustomMemberIdentifier CustomMemberKind         = null,
     IEnumerable <MethodParameterSpec> MethodParameters = null,
     IEnumerable <AttributionSpec> Attributions         = null
 )
     : base(DeclaringTypeName, Name, Documentation, null, AccessLevel ?? ClrAccessKind.Default, IsStatic, Attributions, CustomMemberKind)
 {
     this.IsAbstract       = IsAbstract;
     this.IsVirtual        = IsVirtual;
     this.IsOverride       = IsOverride;
     this.IsSealed         = IsSealed;
     this.IsPartial        = IsPartial;
     this.ReturnType       = ReturnType;
     this.MethodParameters = rovalues(MethodParameters).OrderBy(x => x.Position).ToList();
     this.IsExtension      = IsExtension;
     this.Body             = Body;
 }
Beispiel #8
0
 protected ElementSpec(IClrElementName Name, CodeDocumentationSpec Documentation,
                       ClrAccessKind AccessLevel, IEnumerable <AttributionSpec> Attributions = null)
 {
     this.Name          = Name;
     this.Documentation = Documentation;
     this.AccessLevel   = AccessLevel;
     this.Attributions  = rovalues(Attributions);
 }
Beispiel #9
0
 public MethodInvocationSpec(IClrElementName DeclaringTypeName, ClrMethodName MethodName,
                             bool IsStatic, params MethodArgumentValueSpec[] ArgumentValues
                             )
 {
     this.TypeName       = DeclaringTypeName;
     this.MethodName     = MethodName;
     this.IsStatic       = IsStatic;
     this.ArgumentValues = rovalues(ArgumentValues);
 }
Beispiel #10
0
 public EnumSpec(ClrEnumName Name, ClrAccessKind AccessLevel, ClrTypeReference UnderlyingType,
                 IEnumerable <EnumLiteralSpec> Literals, CodeDocumentationSpec Documentation = null,
                 IEnumerable <AttributionSpec> Attributions = null, IClrElementName DeclaringType = null)
     : base(Name, Documentation, AccessLevel, Attributions ?? array <AttributionSpec>(),
            TypeParameters: array <TypeParameter>(), BaseTypes: array <ClrTypeClosure>(),
            ImplicitRealizations: array <ClrInterfaceName>(), DeclaringType: DeclaringType,
            IsStatic: false, Members: array(Literals))
 {
     this.UnderlyingType = UnderlyingType;
 }
        public MethodArgumentValueSpec(int ArgumentPosition, IClrElementName ArgumentName, IClrExpressionSpec ValueExpression)
        {
            this.ArgumentName    = ArgumentName.SimpleName.Value;
            this.ValueExpression =
                ValueExpression == null
                ? none <IClrExpressionSpec>()
                : some(ValueExpression);

            this.ArgumentPosition = ArgumentPosition;
        }
Beispiel #12
0
 protected MemberSpec(IClrElementName DeclaringTypeName, N MemberName,
                      CodeDocumentationSpec Documentation, int?DeclarationOrder, ClrAccessKind AccessLevel,
                      bool IsStatic, IEnumerable <AttributionSpec> Attributions,
                      ClrCustomMemberIdentifier CustomMember)
     : base(MemberName, Documentation, AccessLevel, Attributions)
 {
     this.DeclaringTypeName = DeclaringTypeName;
     this.DeclarationOrder  = DeclarationOrder;
     this.IsStatic          = IsStatic;
     this.CustomMember      = CustomMember ?? ClrCustomMemberIdentifier.Empty;
 }
Beispiel #13
0
 public FieldSpec(IClrElementName DeclaringTypeName, ClrFieldName Name, ClrTypeReference FieldType,
                  ClrAccessKind?AccessLevel = null, int?DeclarationOrder = null, CodeDocumentationSpec Documentation = null,
                  bool IsStatic             = false, bool IsReadOnly = false, bool IsConst = false,
                  IEnumerable <AttributionSpec> Attributions = null, FieldInitializerSpec Initializer = null,
                  ClrCustomMemberIdentifier CustomMember     = null)
     : base(DeclaringTypeName, Name, Documentation, DeclarationOrder, AccessLevel ?? ClrAccessKind.Default,
            IsStatic, Attributions, CustomMember)
 {
     this.FieldType        = FieldType;
     this.IsReadOnly       = IsReadOnly;
     this.IsConst          = IsConst;
     this.FieldInitializer = Initializer;
 }
Beispiel #14
0
 public PropertySpec(IClrElementName DeclaringTypeName, ClrPropertyName Name, ClrTypeReference PropertyType,
                     ClrAccessKind?AccessLevel = null, int?DeclarationOrder = null, CodeDocumentationSpec Documentation = null,
                     bool CanRead = true, ClrAccessKind?ReadAccessLevel     = null, bool CanWrite    = true,
                     ClrAccessKind?WriteAccessLevel = null, bool IsStatic   = false, bool IsAbstract = false, bool IsVirtual = false,
                     bool IsOverride = false, bool IsSealed = false, IEnumerable <AttributionSpec> Attributions = null,
                     ClrCustomMemberIdentifier CustomMember = null, bool IsNew = false)
     : base(DeclaringTypeName, Name, Documentation, DeclarationOrder, AccessLevel ?? ClrAccessKind.Default,
            IsStatic, Attributions ?? array <AttributionSpec>(), CustomMember)
 {
     this.PropertyType     = PropertyType;
     this.CanRead          = CanRead;
     this.ReadAccessLevel  = ReadAccessLevel ?? ClrAccessKind.Default;
     this.CanWrite         = CanWrite;
     this.WriteAccessLevel = WriteAccessLevel ?? ClrAccessKind.Default;
     this.IsAbstract       = IsAbstract;
     this.IsVirtual        = IsVirtual;
     this.IsOverride       = IsOverride;
     this.IsSealed         = IsSealed;
     this.IsNew            = IsNew;
 }
Beispiel #15
0
 public AutoPropertySpec
 (
     IClrElementName DeclaringTypeName,
     ClrPropertyName Name,
     ClrTypeReference PropertyType,
     ClrAccessKind?AccessLevel      = null,
     int?DeclarationOrder           = null,
     string Documentation           = null,
     ClrAccessKind?ReadAccessLevel  = null,
     ClrAccessKind?WriteAccessLevel = null,
     bool IsStatic   = false,
     bool IsAbstract = false,
     bool IsVirtual  = false,
     bool IsOverride = false,
     bool IsSealed   = false,
     IEnumerable <AttributionSpec> Attributions = null,
     ClrCustomMemberIdentifier CustomMember     = null,
     bool IsNew = false
 )
     :
     base
     (
         DeclaringTypeName,
         Name: Name,
         PropertyType: PropertyType,
         AccessLevel: AccessLevel,
         DeclarationOrder: DeclarationOrder,
         Documentation: new ElementDescription(Documentation),
         ReadAccessLevel: ReadAccessLevel,
         WriteAccessLevel: WriteAccessLevel,
         IsAbstract: IsAbstract,
         IsStatic: IsStatic,
         IsVirtual: IsVirtual,
         IsOverride: IsOverride,
         IsSealed: IsSealed,
         Attributions: Attributions,
         CustomMember: CustomMember,
         IsNew: IsNew
     )
 {
 }
Beispiel #16
0
 public ClassSpec
 (
     ClrClassName Name,
     CodeDocumentationSpec Documentation                 = null,
     ClrAccessKind?AccessLevel                           = null,
     IEnumerable <AttributionSpec> Attributions          = null,
     IEnumerable <TypeParameter> TypeParameters          = null,
     IEnumerable <ClrTypeClosure> BaseTypes              = null,
     IEnumerable <ClrInterfaceName> ImplicitRealizations = null,
     IClrElementName DeclaringType                       = null,
     bool IsStatic = false,
     IEnumerable <IClrMemberSpec> Members = null,
     bool IsPartial = false,
     bool IsSealed  = false,
     IEnumerable <IClrTypeSpec> DeclaredTypes = null,
     bool IsAbstract = false
 )
     : base
     (
         Name,
         Documentation,
         AccessLevel ?? ClrAccessKind.Public,
         Attributions ?? array <AttributionSpec>(),
         TypeParameters ?? array <TypeParameter>(),
         BaseTypes ?? array <ClrTypeClosure>(),
         ImplicitRealizations ?? array <ClrInterfaceName>(),
         DeclaringType,
         IsStatic,
         Members ?? array <IClrMemberSpec>(),
         IsPartial: IsPartial
     )
 {
     this.IsSealed      = IsSealed;
     this.DeclaredTypes = rolist(DeclaredTypes);
     this.IsAbstract    = IsAbstract;
 }
Beispiel #17
0
 public TypeTemplateSpec(IClrElementName TypeName, string TemplateText, params NamedValue[] Parameters)
 {
     this.TypeName     = TypeName;
     this.TemplateText = TemplateText;
     this.Parameters   = Parameters.ToList();
 }
Beispiel #18
0
 /// <summary>
 /// Defines a literal value
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public static LiteralValueSpec SpecifyLiteralValue(this IClrElementName name)
 => name.SimpleName.Value.SpecifyLiteralValue();