public static EvasObject CreateEvasObject(this Page page, EvasObject parent, bool hasAlpha = false) { if (!Platform.Tizen.Forms.IsInitialized) { throw new InvalidOperationException("call Forms.Init() before this"); } if (parent == null) { throw new InvalidOperationException("Window could not be null"); } if (!(page.RealParent is Application)) { Application app = new DefaultApplication(); app.MainPage = page; } var platform = new Platform.Tizen.Platform(Platform.Tizen.Forms.Context, parent) { HasAlpha = hasAlpha }; platform.SetPage(page); return(platform.InternalNaviframe); }
public void SetPage(Page page) { var application = new DefaultApplication { MainPage = page }; LoadApplication(application); }
public static UIElement ConvertPageToUIElement(this Page page, WpfApplicationPage applicationPage) { var application = new DefaultApplication(); application.MainPage = page; var result = new Platform(applicationPage); result.SetPage(page); return(result.GetCanvas()); }
static void Main(string[] args) { var runtime = DefaultApplication.Build().Bootstrap ( new GameDisplayablesServices(), new GameServices(), new CommandServices(), new LexiconServices(), new NlpServices(), new DeterminationServices(), new IteratorServices(), new ComDisplayablesServices() ); var commandBootstrap = new CommandBootstrap(runtime); var gameBootstrap = new GameBootstrap(runtime); commandBootstrap.Initiate(); gameBootstrap.Initiate(); string stringInput; do { Console.Write(@"> "); stringInput = Console.ReadLine(); var successfulDetermination = commandBootstrap.BootstrapCommandDetermination(stringInput); if (successfulDetermination) { var commandResultListener = runtime.Container.Resolve <ResultListener>(); var commandResultSubscriber = runtime.Container.Resolve <ResultSubscriber>(new TypedParameter(typeof(ResultListener), commandResultListener)); commandResultSubscriber.Subscribe(commandBootstrap.GetCommandResultModelHandlerForGame()); commandBootstrap.BootstrapCommandResult(); commandResultSubscriber.Unsubscribe(); if (commandResultListener.GetObjectThatWasChanged() != null) { gameBootstrap.ProcessCommand(commandResultListener.GetObjectThatWasChanged(), commandResultListener.GetPropsThatWereChanged()); } else { Debug.WriteLine("ERROR: Listener didn't capture any command result model that was changed."); } } } while (stringInput != null && stringInput.ToLower() != "exit"); }
static Goui.Html.Element CreateElement(this Xamarin.Forms.Page page) { if (!(page.RealParent is Application)) { var app = new DefaultApplication(); app.MainPage = page; } var result = new Goui.Forms.Platform(); result.SetPage(page); return(result.Element); }
/// <summary> /// Main. /// </summary> public static void Main() { DefaultApplication .ConfigureApp <Application>() .ConfigureServices(x => { x.AddDataContext <MySqlDataProvider, ExampleDbContext>(); x.AddEventing <EasyNetQProvider>(); }) .Build() .Run(); }
public static NSViewController CreateViewController(this Page view) { if (!Forms.IsInitialized) { throw new InvalidOperationException("call Forms.Init() before this"); } if (!(view.RealParent is Application)) { Application app = new DefaultApplication(); app.MainPage = view; } var result = new Platform(); result.SetPage(view); return(result.ViewController); }
public static UIViewController CreateViewController(this Page page) { if (!Forms.IsInitialized) { throw new InvalidOperationException("call Forms.Init() before this"); } if (!(page.RealParent is Application)) { Application app = new DefaultApplication(); app.MainPage = page; } var result = new Platform.iOS.Doodle.DoodlePlatform(); //var result = new Platform.iOS.Doodle.Platform(); result.SetPage(page); return(result.ViewController); }
public static GtkFormsContainer CreateContainer(this Page view) { if (!System.Maui.Maui.IsInitialized) { throw new InvalidOperationException("call System.Maui.Maui.Init() before this"); } if (!(view.RealParent is Application)) { Application app = new DefaultApplication(); app.MainPage = view; } var result = new Platform(); result.SetPage(view); return(result.PlatformRenderer); }
#pragma warning restore 618 public static Fragment CreateSupportFragment(this ContentPage view, Context context) { if (!Forms.IsInitialized) { throw new InvalidOperationException("call Forms.Init() before this"); } if (!(view.RealParent is Application)) { Application app = new DefaultApplication(); app.MainPage = view; } var platform = new Platform(context, true); platform.SetPage(view); var vg = platform.GetViewGroup(); return(new EmbeddedSupportFragment(vg, platform)); }
public static Control ToControl(this Page view) { if (!Forms.IsInitialized) { throw new InvalidOperationException("Call Forms.Init() before this"); } if (!(view.RealParent is Application)) { Application app = new DefaultApplication { MainPage = view }; var formsApplicationPage = new FormsApplicationPage(); formsApplicationPage.LoadApplication(app); var platform = new Platform(formsApplicationPage); platform.SetPage(view); } IVisualElementRenderer renderer = Platform.GetOrCreateRenderer(view); if (renderer == null) { throw new InvalidOperationException($"Could not find or create a renderer for {view}"); } var Control = renderer.GetNativeElement(); Control.AttachedToLogicalTree += (sender, e) => { view.Layout(new Rectangle(0, 0, Control.Bounds.Width, Control.Bounds.Height)); }; return(Control); }
public static FrameworkElement ToFrameworkElement(this Page view) { if (!System.Maui.Maui.IsInitialized) { throw new InvalidOperationException("Call System.Maui.Maui.Init() before this"); } if (!(view.RealParent is Application)) { Application app = new DefaultApplication { MainPage = view }; var formsApplicationPage = new FormsApplicationPage(); formsApplicationPage.LoadApplication(app); var platform = new Platform(formsApplicationPage); platform.SetPage(view); } IVisualElementRenderer renderer = Platform.GetOrCreateRenderer(view); if (renderer == null) { throw new InvalidOperationException($"Could not find or create a renderer for {view}"); } var frameworkElement = renderer.GetNativeElement(); frameworkElement.Loaded += (sender, args) => { view.Layout(new Rectangle(0, 0, frameworkElement.ActualWidth, frameworkElement.ActualHeight)); }; return(frameworkElement); }
public static EvasObject CreateEvasObject(this Page page, EvasObject parent, bool hasAlpha = false) { if (!Forms.IsInitialized) { throw new InvalidOperationException("call Forms.Init() before this"); } if (parent == null) { throw new InvalidOperationException("Window could not be null"); } if (!(page.RealParent is Application)) { Application app = new DefaultApplication(); app.MainPage = page; } var platform = Platform.Tizen.Platform.CreatePlatform(parent); platform.HasAlpha = hasAlpha; platform.SetPage(page); return(platform.GetRootNativeView()); }
public static async Task <IWebHost> StartServer(StartServerOptions options) { await DefaultApplication.Start(options); return(DefaultApplication.GetHost()); }