示例#1
0
文件: Main.cs 项目: KDet/MailingApp
		static void Main (string[] args)
		{
			var platform = Eto.Platform.Detect;
			var main = new MainForm ();
			var app = new Application (platform);
			app.Run(main);
		}
示例#2
0
文件: Main.cs 项目: hultqvist/Eto
		public static void Main (string[] args)
		{
			var app = new Application ();
			
			app.Initialized += delegate {
				app.MainForm = new MyForm ();
				app.MainForm.Show ();
			};
			app.Run (args);
		}
示例#3
0
    public static void Main()
    {
        string launcherDataPath = GenerateCurrentPath();

        // Make sure first, ~/.local/share/AM2RLauncher exists
        if (!Directory.Exists(launcherDataPath))
        {
            Directory.CreateDirectory(launcherDataPath);
        }

        // Now, see if log4netConfig exists, if not write it again.
        if (!File.Exists(launcherDataPath + "/log4net.config"))
        {
            File.WriteAllText(launcherDataPath + "/log4net.config", Properties.Resources.log4netContents.Replace("${DATADIR}", launcherDataPath));
        }

        // Configure logger
        XmlConfigurator.Configure(new FileInfo(launcherDataPath + "/log4net.config"));

        // if we're on debug, always set loglevel to debug
        #if DEBUG
        ((Logger)log.Logger).Level = log4net.Core.Level.Debug;
        #endif

        // Log distro and version (if it exists)
        if (File.Exists("/etc/os-release"))
        {
            string osRelease = File.ReadAllText("/etc/os-release");
            Regex  lineRegex = new Regex(".*=.*");
            var    results   = lineRegex.Matches(osRelease).ToList();
            var    version   = results.FirstOrDefault(x => x.Value.Contains("VERSION"));
            log.Info("Current Distro: " + results.FirstOrDefault(x => x.Value.Contains("NAME"))?.Value.Substring(5).Replace("\"", "") +
                     (version == null ? "" : " " + version.Value.Substring(8).Replace("\"", "")));
        }
        else
        {
            log.Error("Couldn't determine the currently running distro!");
        }


        try
        {
            Application gtkLauncher = new Application(Eto.Platforms.Gtk);
            LauncherUpdater.Main();
            gtkLauncher.UnhandledException += GTKLauncher_UnhandledException;
            gtkLauncher.Run(new MainForm());
        }
        catch (Exception e)
        {
            log.Error("An unhandled exception has occurred: \n*****Stack Trace*****\n\n" + e.StackTrace);
            Console.WriteLine(Language.Text.UnhandledException + "\n" + e.Message + "\n*****Stack Trace*****\n\n" + e.StackTrace);
            Console.WriteLine("Check the logs at " + launcherDataPath + " for more info!");
        }
    }
示例#4
0
        static void Main(string[] args)
        {
            Application application = new Application(Platform.Detect);

            MainForm mainForm = new MainForm();

            ApplicationContext applicationContext = new ApplicationContext();
            IViewContext viewContext = new ViewContext(mainForm);

            mainForm.DataContext = new MainFormViewModel(applicationContext, viewContext);

            application.Run(mainForm);
        }
示例#5
0
文件: Startup.cs 项目: hultqvist/Eto
		// This is the main entry point of the application.
		static void Main (string[] args)
		{
			// TODO: make desktop tests work in iOS
			// This will require much more work on iOS port to implement required events and controls
			//var app = new TestApplication (new Eto.Platform.iOS.Generator ());
			//app.Run (args);

			var app = new Application (new Eto.Platform.iOS.Generator ());
			app.Initialized += delegate {
				app.MainForm = new MainForm ();
				app.MainForm.Show ();
			};
			app.Run (args);
		}
示例#6
0
        static void Main(string[] args)
        {
            var app = new Eto.Forms.Application();

            var path     = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) ?? "";
            var userpath = Path.Combine(path, "userpath");

            CSycles.path_init(path, userpath);
            CSycles.initialise();

            var csf = new CSyclesForm(path)
            {
                ClientSize = new ed.Size((int)1024, (int)768),
            };

            app.Run(csf);

            CSycles.shutdown();
        }
示例#7
0
文件: Startup.cs 项目: Exe0/Eto
		public void SetUp()
		{
			if (Application.Instance == null)
			{
				#if DESKTOP
				var generatorTypeName = ConfigurationManager.AppSettings["generator"];
				#else
				string generatorTypeName = null;
				#endif
				var ev = new ManualResetEvent(false);
				Exception exception = null;
				var thread = new Thread(() =>
				{
					try
					{
						Generator generator;
						if (string.IsNullOrEmpty(generatorTypeName))
							generator = Generator.Detect;
						else
							generator = Generator.GetGenerator(generatorTypeName);

						var app = new Application(generator);
						app.Initialized += (sender, e) => ev.Set();
						app.Run();
					}
					catch (Exception ex)
					{
						exception = ex;
					}
				});
				thread.SetApartmentState(ApartmentState.STA);
				thread.Start();
				if (!ev.WaitOne(10000))
					Assert.Fail("Could not initialize generator");
				if (exception != null)
					throw new Exception("Error initializing generator", exception);
			}
		}
示例#8
0
        static void Main(string[] args)
        {
            var app = new Eto.Forms.Application();

            var path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) ?? "";
            var userpath = Path.Combine(path, "userpath");

            CSycles.path_init(path, userpath);
            CSycles.initialise();

            var csf = new CSyclesForm(path)
            {
                ClientSize = new ed.Size((int)1024, (int)768),
            };

            app.Run(csf);

            CSycles.shutdown();
        }
示例#9
0
 static void Main()
 {
     using (Application application = new Application())
     {
         BrowserWindow form = new BrowserWindow();
         application.Run(form);
     }
 }
示例#10
0
 public static void Main()
 {
     Application app = new Application();
     MainForm form = new MainForm();
     app.Run(form);
 }