Esempio n. 1
0
 public static Class ForComplex(OdcmClass odcmClass)
 {
     return(new Class
     {
         AbstractModifier = odcmClass.IsAbstract ? "abstract " : string.Empty,
         AccessModifier = "public ",
         Constructors = global::Vipr.Writer.CSharp.Constructors.ForComplex(odcmClass),
         BaseClass =
             new Type(odcmClass.Base == null
                 ? NamesService.GetExtensionTypeName("ComplexTypeBase")
                 : NamesService.GetPublicTypeName(odcmClass.Base)),
         Description = odcmClass.Description,
         Fields = global::Vipr.Writer.CSharp.Fields.ForComplex(odcmClass),
         Identifier = NamesService.GetConcreteTypeName(odcmClass),
         Properties = global::Vipr.Writer.CSharp.Properties.ForComplex(odcmClass),
     });
 }
Esempio n. 2
0
 public EntityInstanceFunctionMethod(OdcmMethod odcmMethod) : base(odcmMethod)
 {
     InstanceName = NamesService.GetConcreteTypeName(odcmMethod.ReturnType);
     ReturnType   = Type.TaskOf(new Type(NamesService.GetPublicTypeName(odcmMethod.ReturnType)));
 }
 public EntityCollectionFunctionMethod(OdcmMethod odcmMethod) : base(odcmMethod)
 {
     ReturnType = Type.TaskOf(Type.IEnmerableOf(new Type(NamesService.GetPublicTypeName(odcmMethod.ReturnType))));
 }
 private StructuralCollectionProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     InstanceType = new Type(NamesService.GetPublicTypeName(odcmProperty.Type));
     Type         = new Type(new Identifier("System.Collections.Generic", "IList"), InstanceType);
 }
Esempio n. 5
0
 public static Type GetParameterType(OdcmParameter parameter)
 {
     return(parameter.IsNullable && IsValueType(parameter.Type) && !(parameter.Type is OdcmEnum)
         ? GetNullableType(parameter.Type)
         : new Type(NamesService.GetPublicTypeName(parameter.Type)));
 }
Esempio n. 6
0
 public static Type GetPropertyType(OdcmProperty property)
 {
     return(property.IsNullable && IsValueType(property.Type) && !(property.Type is OdcmEnum)
         ? GetNullableType(property.Type)
         : new Type(NamesService.GetPublicTypeName(property.Type)));
 }
Esempio n. 7
0
 public static Type GetNullableType(OdcmType type)
 {
     return(new Type(new Identifier("System", "Nullable"), new Type(NamesService.GetPublicTypeName(type))));
 }