Пример #1
0
 public TypeProperty(string name, ITypeReference typeReference, TypePropertyFlags flags = TypePropertyFlags.None, string?description = null)
 {
     this.Name          = name;
     this.TypeReference = typeReference;
     this.Flags         = flags;
     this.Description   = description;
 }
Пример #2
0
 public NamedObjectType(string name, TypeSymbolValidationFlags validationFlags, IEnumerable <TypeProperty> properties, ITypeReference?additionalPropertiesType, TypePropertyFlags additionalPropertiesFlags = TypePropertyFlags.None, IEnumerable <FunctionOverload>?functions = null)
     : base(name)
 {
     this.ValidationFlags           = validationFlags;
     this.Properties                = properties.ToImmutableDictionary(property => property.Name, LanguageConstants.IdentifierComparer);
     this.MethodResolver            = FunctionResolver.Create(functions);
     this.AdditionalPropertiesType  = additionalPropertiesType;
     this.AdditionalPropertiesFlags = additionalPropertiesFlags;
 }
Пример #3
0
 public ObjectType(string name, TypeSymbolValidationFlags validationFlags, IEnumerable <TypeProperty> properties, ITypeReference?additionalPropertiesType, TypePropertyFlags additionalPropertiesFlags, Func <ObjectType, FunctionResolver> methodResolverBuilder)
     : base(name)
 {
     this.ValidationFlags           = validationFlags;
     this.Properties                = properties.ToImmutableDictionary(property => property.Name, LanguageConstants.IdentifierComparer);
     this.MethodResolver            = methodResolverBuilder(this);
     this.AdditionalPropertiesType  = additionalPropertiesType;
     this.AdditionalPropertiesFlags = additionalPropertiesFlags;
 }
Пример #4
0
 public ObjectType(string name, TypeSymbolValidationFlags validationFlags, IEnumerable <TypeProperty> properties, ITypeReference?additionalPropertiesType, TypePropertyFlags additionalPropertiesFlags = TypePropertyFlags.None, IEnumerable <FunctionOverload>?functions = null)
     : this(name, validationFlags, properties, additionalPropertiesType, additionalPropertiesFlags, owner => new FunctionResolver(owner, functions ?? ImmutableArray <FunctionOverload> .Empty))
 {
 }
Пример #5
0
 public NamedObjectType(string name, IEnumerable <TypeProperty> properties, ITypeReference?additionalProperties, TypePropertyFlags additionalPropertiesFlags = TypePropertyFlags.None)
     : base(name)
 {
     this.Properties                = properties.ToImmutableDictionary(property => property.Name, property => property, LanguageConstants.IdentifierComparer);
     this.AdditionalProperties      = additionalProperties;
     this.AdditionalPropertiesFlags = additionalPropertiesFlags;
 }
Пример #6
0
 private static TypePropertyFlags ConvertToReadOnly(TypePropertyFlags typePropertyFlags)
 => (typePropertyFlags | TypePropertyFlags.ReadOnly) & ~TypePropertyFlags.Required;
Пример #7
0
 public TypeProperty(string name, ITypeReference typeReference, TypePropertyFlags flags = TypePropertyFlags.None)
 {
     this.Name          = name;
     this.TypeReference = typeReference;
     this.Flags         = flags;
 }
Пример #8
0
 public TypeProperty(string name, TypeSymbol type, TypePropertyFlags flags = TypePropertyFlags.None)
 {
     this.Name  = name;
     this.Type  = type;
     this.Flags = flags;
 }