/// <summary> /// Generate code to support a metric type /// </summary> internal void ProcessMetricType(MetricType type, CodeNamespace generatedNamespace) { // Handle non-POCO types if (!type.IsAliasedType()) { // Generate strongly typed code for types that contain "allowed values" generatedNamespace.Types.Add(GenerateEnumStruct(type)); } }
public static Type GetAliasedType(this MetricType type) { if (!type.IsAliasedType()) { throw new Exception($"type not aliased: {type.type}"); } return(AliasedTypes[type.type]); }
public static string GetGeneratedTypeName(this MetricType type) { var typeName = type.name; if (type.IsAliasedType()) { typeName = type.GetAliasedType().FullName; } return(typeName.ToPascalCase()); }