Ejemplo n.º 1
1
			/// <summary>
			/// Raises the initialized event.
			/// </summary>
			public void OnInitialized(Application widget, EventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnInitialized(e));
			}
Ejemplo n.º 2
0
		static void Main (string[] args)
		{
			var platform = Eto.Platform.Detect;
			var main = new MainForm ();
			var app = new Application (platform);
			app.Run(main);
		}
Ejemplo n.º 3
0
		public void Init(string platformType, string initializeAssembly, string mainAssembly, IEnumerable<string> references)
		{
			if (Platform.Instance == null)
			{
				var refs = new[] { Path.GetDirectoryName(typeof(AppDomainProxy).Assembly.Location), mainAssembly };
				resolver = AssemblyResolver.Register(refs.Union(references));

				var plat = Activator.CreateInstance(Type.GetType(platformType)) as Platform;
				Platform.Initialize(plat);
				if (!string.IsNullOrEmpty(initializeAssembly))
				{
					plat.LoadAssembly(initializeAssembly);
				}
				var app = new Application();
				app.Attach();
				app.Terminating += App_Terminating;

				app.UnhandledException += App_UnhandledException;

				AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload;
			}

			designPanel = new DesignPanel();
			designPanel.MainAssembly = mainAssembly;
			designPanel.References = references.ToList();
		}
Ejemplo n.º 4
0
		public static void Main (string[] args)
		{
			var app = new Application ();
			
			app.Initialized += delegate {
				app.MainForm = new MyForm ();
				app.MainForm.Show ();
			};
			app.Run (args);
		}
Ejemplo n.º 5
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!");
        }
    }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
		// 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);
		}
Ejemplo n.º 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();
        }
Ejemplo n.º 9
0
Archivo: Startup.cs Proyecto: 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);
			}
		}
Ejemplo n.º 10
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();
        }
Ejemplo n.º 11
0
			/// <summary>
			/// Raises the terminating event.
			/// </summary>
			public void OnTerminating(Application widget, CancelEventArgs e)
			{
				widget.Platform.Invoke(() => widget.OnTerminating(e));
			}
Ejemplo n.º 12
0
 static void Main()
 {
     using (Application application = new Application())
     {
         BrowserWindow form = new BrowserWindow();
         application.Run(form);
     }
 }
Ejemplo n.º 13
0
 public static void Main()
 {
     Application app = new Application();
     MainForm form = new MainForm();
     app.Run(form);
 }
Ejemplo n.º 14
0
 public EtoFormsPlatform(Eto.Platform platform)
 {
     EtoApplication = new Eto.Forms.Application(platform);
 }