Example #1
0
        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);
        }
Example #2
0
        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();
        }
Example #3
0
 public Writer(EnumGenie enumGenie)
 {
     _enumGenie = enumGenie;
 }
Example #4
0
 public Filter(EnumGenie enumGenie)
 {
     _enumGenie = enumGenie;
 }
Example #5
0
 public Transform(EnumGenie enumGenie)
 {
     _enumGenie = enumGenie;
 }
Example #6
0
 public Source(EnumGenie enumGenie)
 {
     _enumGenie = enumGenie;
 }