/// <summary> /// Creates a new job. /// </summary> /// <param name="data">Data of the file which will be generated.</param> public Job(Data data) { type = data switch { ClassData _ => JobType.Class, FlagData _ => JobType.Flag, EnumeratedData _ => JobType.Enumerated, InterfaceData _ => JobType.Interface, _ => type }; this.data = data; Console.WriteLine($"Created job for {data.Namespace}.{data.Name}."); }
private static void CreateTransformTypeJob() { var typeEnumData = new EnumeratedData { Name = "TransformTypeEnum", Namespace = Namespace, Description = new[] { "Determines the type of the transform." }, Values = _schema.Transforms.Select(keyValue => new EnumeratedValue { DisplayName = keyValue.Key, EnumName = keyValue.Key.ToDotNetFriendlyName(_dictionary) }) }; Jobs.Add($"{typeEnumData.Namespace}.{typeEnumData.Name}", new Job(typeEnumData)); }
private static void CreateTraceTypeEnumJob() { var typeEnumData = new EnumeratedData { Name = "TraceTypeEnum", Namespace = $"{Namespace}", Description = new[] { "Determines the type of the trace." }, Values = _schema.Traces.Select(keyValue => new EnumeratedValue { DisplayName = keyValue.Value.Attributes.ContainsKey("type") ? keyValue.Value.Attributes["type"].GetString() : keyValue.Key, EnumName = keyValue.Key.ToDotNetFriendlyName(_dictionary) }) }; Jobs.Add($"{typeEnumData.Namespace}.{typeEnumData.Name}", new Job(typeEnumData)); }