/// <summary> /// This function initializices everything in EFL and runs your application. /// This call will result in a call to OnInitialize(), which you application should override. /// </summary> public void Launch(Efl.Csharp.Components components = Components.Ui) { Init(components); Efl.App app = Efl.App.AppMain; Eina.Array <String> command_line = new Eina.Array <String>(); command_line.Append(Environment.GetCommandLineArgs()); #if EFL_BETA app.SetCommandArray(command_line); #endif app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => { if (evt.arg.Initialization) { OnInitialize(evt.arg.Argv); } OnArguments(evt.arg); }; app.PauseEvt += (object sender, EventArgs e) => { OnPause(); }; app.ResumeEvt += (object sender, EventArgs e) => { OnResume(); }; app.TerminateEvt += (object sender, EventArgs e) => { OnTerminate(); }; app.Begin(); Shutdown(); }
/// <summary> /// This function initializices everything in EFL and runs your application. /// This call will result in a call to OnInitialize(), which you application should override. /// <para>Since EFL 1.23.</para> /// </summary> /// <param name="components">The <see cref="Efl.Csharp.Components" /> to run the application.</param> public void Launch(Efl.Csharp.Components components = Components.All) { Init(components); Efl.App app = Efl.App.AppMain; var command_line = new Eina.Array <Eina.Stringshare>(); //command_line.Add(List.ConvertAll(Environment.GetCommandLineArgs(), s => (Eina.Stringshare)s)); //command_line.AddRange(Environment.GetCommandLineArgs()); #if EFL_BETA app.SetCommandArray(command_line); #endif app.ArgumentsEvent += (object sender, LoopArgumentsEventArgs evt) => { if (evt.arg.Initialization) { var evtArgv = evt.arg.Argv; int n = evtArgv.Count; var argv = new string[n]; for (int i = 0; i < n; ++i) { argv[i] = evtArgv[i]; } OnInitialize(argv); } OnArguments(evt.arg); }; app.PauseEvent += (object sender, EventArgs e) => { OnPause(); }; app.ResumeEvent += (object sender, EventArgs e) => { OnResume(); }; app.TerminateEvent += (object sender, EventArgs e) => { OnTerminate(); }; app.Begin(); command_line.Dispose(); Shutdown(); }