public bool TryGetEnumType(string typeFullName, out EnumType enumType) { return _enumTypes.TryGetValue(typeFullName, out enumType); }
public void AddEnumType(string typeFullName, EnumType enumType) { _enumTypes.Add(typeFullName, enumType); }
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); } }