Esempio n. 1
0
        static void Main(string[] args)
        {
            var app = Carlo.Launch(new Options());

            app.ServeFolder("./wwwroot");

            app.Load("index.html");

            app.Exit += OnAppExit;

            var thread = new Thread((s) =>
            {
                while (true)
                {
                    app.MainWindow?.SendIpcMessageAsync("message-from-csharp", DateTime.Now.ToString());

                    Thread.Sleep(1000);
                }
            });

            thread.IsBackground = true;
            thread.Start();

            _exitEvent.WaitOne();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            _app = Carlo.Launch(new Options()
            {
                Title   = "Photobooth",
                Width   = 800,
                Height  = 648 + 24,
                Channel = new string[] { "canary" }
            });

            _app.ServeFolder("./www");

            _app.ExposeFunctionAsync <string, JObject>("saveImage", SaveImage).Wait();

            _app.Load("index.html");

            _app.Exit += OnAppExit;

            _exitEvent.WaitOne();
        }
Esempio n. 3
0
        public static void Main(string[] args)
        {
            var app = Carlo.Launch(new Options()
            {
                Title   = "Carlo# - Angular",
                Width   = 1024,
                Height  = 600,
                Channel = new string[] { "*" }
            });

            var controller = new WeatherForecastController(app.MainWindow);

            app.ServeFolder("./wwwroot/dist");

            app.Load("index.html");

            app.Exit += OnAppExit;

            _exitEvent.WaitOne();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var app = Carlo.Launch(new Options()
            {
                BgColor = Color.FromArgb(0x2b, 0x2e, 0x3b),
                Title   = "Carlo# - Systeminfo App",
                Width   = 1000,
                Height  = 500,
                Channel = new string[] { "canary", "stable" },
                Icon    = "./app_icon.png",
            });

            app.ServeFolder("./www");

            app.ExposeFunctionAsync("systeminfo", GetSystemInfo).Wait();

            app.Load("index.html");

            app.Exit += OnAppExit;

            _exitEvent.WaitOne();
        }
Esempio n. 5
0
        public static void Main(string[] args)
        {
            _host = CreateWebHostBuilder(args).Build();

            var runTask = _host.RunAsync();

            var app = Carlo.Launch(new Options()
            {
                Title   = "Carlo# - Angular with hot reload",
                Width   = 1024,
                Height  = 600,
                Channel = new string[] { "stable" }
            });

            app.Exit += App_OnExit;

            app.ServeOrigin("https://localhost:5001");

            app.LoadAsync("index.html").Wait();

            runTask.Wait();
        }