Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public ProgressReporter(SharpGenModel model)
 {
     this.model = model;
 }
Esempio n. 3
0
 public ProgressView(SharpGenModel model)
     : this()
 {
     DataContext = model;
 }