public static void Main() { var customWriter = new EnumsSummaryStringWriter(); var genie = new EnumGenie() .SourceFrom.Assembly(typeof(Program).Assembly) .FilterBy.Predicate(t => t != typeof(Ignored)) .TransformBy.RenamingEnum(def => def.Name.Replace("StripThisOut", "")) .WriteTo.Console(cfg => cfg.TypeScript(ts => ts.Declaration() .Description() .Descriptor() ) ) .WriteTo.File("./TypeScript/enums.ts", cfg => cfg.TypeScript(ts => ts.Declaration(c => c.AsConst()) .Description() .Descriptor(c => c.AsConst()) )) .WriteTo.Custom(customWriter); genie.Write(); Console.WriteLine("Output from custom writer: " + Environment.NewLine + customWriter.Output); }
public static void Main() { var genie = new EnumGenie() .SourceFrom.Assembly(typeof(Program).Assembly) .FilterBy.Predicate(t => t != typeof(Ignored)) .TransformBy.RenamingEnum(def => def.Name.Replace("StripThisOut", "")) .WriteTo.Console(cfg => cfg.TypeScript(ts => ts.Declaration() .Description() .Descriptor() ) ) .WriteTo.File("./TypeScript/enums.ts", cfg => cfg.TypeScript(ts => ts.Declaration(c => c.AsConst()) .Description() .Descriptor(c => c.AsConst()) )); genie.Write(); }
public Writer(EnumGenie enumGenie) { _enumGenie = enumGenie; }
public Filter(EnumGenie enumGenie) { _enumGenie = enumGenie; }
public Transform(EnumGenie enumGenie) { _enumGenie = enumGenie; }
public Source(EnumGenie enumGenie) { _enumGenie = enumGenie; }