Ejemplo n.º 1
0
 public Enum(OdcmEnum odcmEnum)
 {
     Name = odcmEnum.Name;
     Description = odcmEnum.Description;
     // if no Underlying type is specified then default to 'int'.
     UnderlyingType =
         odcmEnum.UnderlyingType == null
             ? "int"
             : NamesService.GetPrimitiveTypeKeyword(odcmEnum.UnderlyingType);
     Members = odcmEnum.Members.Select(m => new EnumMember(m));
 }
Ejemplo n.º 2
0
 public static IEnumerable<Feature> ForOdcmEnum(OdcmEnum odcmEnum)
 {
     return new[]
     {
         new Feature 
         {
             Enums = new[]
             {
                 new Enum(odcmEnum)
             }
         }
     };
 }
Ejemplo n.º 3
0
        public static OdcmEnum OdcmEnum(Action<OdcmEnum> config = null)
        {
            var retVal = new OdcmEnum(Any.CSharpIdentifier(), Any.EmptyOdcmNamespace());
            retVal.UnderlyingType = Any.EnumUnderlyingType();

            if (config != null) config(retVal);

            return retVal;
        }