static void Main(string[] args) { var appBuilder = BuildAvaloniaApp().SetupWithoutStarting(); var model = new SharpGenModel(); var logger = new Logger(new ConsoleLogger(), new SharpGenModel.ProgressReporter(model)); var codeGenApp = new CodeGenApp(logger) { GlobalNamespace = new GlobalNamespaceProvider("SharpGen.Runtime") }; ParseArguments(args, codeGenApp); var window = new ProgressView(new SharpGenModel()); window.Show(); Task.Run(() => { if (codeGenApp.Init()) { try { logger.Progress(0, "Starting code generation..."); codeGenApp.Run(); } catch (Exception ex) { logger.Fatal("Unexpected exception", ex); } finally { Application.Current.Exit(); } } }); appBuilder.Instance.Run(window); }
public ProgressReporter(SharpGenModel model) { this.model = model; }
public ProgressView(SharpGenModel model) : this() { DataContext = model; }