示例#1
0
 public bool TryGetEnumType(string typeFullName, out EnumType enumType)
 {
     return _enumTypes.TryGetValue(typeFullName, out enumType);
 }
示例#2
0
 public void AddEnumType(string typeFullName, EnumType enumType)
 {
     _enumTypes.Add(typeFullName, enumType);
 }
示例#3
0
 private void BuildCodeEnum(TypeContext typeContext, CodeEnum codeEnum, CodeClass owner = null)
 {
     if (codeEnum == null) return;
     CodeAttribute attribute;
     EnumType enumType = null;
     if (owner != null)
     {
         var tsType = typeContext.GetTypeScriptType(owner.FullName);
         if (tsType != null)
             enumType = new EnumType(codeEnum.Name);
     }
     if (TryGetAttribute(codeEnum.Attributes, EnumAttributeFullName, out attribute))
     {
         var values = GetEnumValues(codeEnum, attribute);
         enumType = new EnumType(values);
     }
     if (enumType != null)
     {
         if (!typeContext.ContainsEnumType(codeEnum.FullName))
             typeContext.AddEnumType(codeEnum.FullName, enumType);
     }
 }