public static void RunBackgroundTask(IBackgroundTask task, IBackgroundTaskInstance taskInstance, IShinyStartup startup) { if (!ShinyHost.IsInitialized) { UwpPlatform.SetBackgroundTask(task.GetType()); ShinyHost.Init(new UwpPlatform(null), startup); } var services = ShinyHost.ServiceProvider; //if (taskInstance.Task.Name.StartsWith("JOB-")) //{ // services // .Resolve<JobManager>(true)! // .Process(taskInstance); //} //else //{ // var targetType = Type.GetType(taskInstance.Task.Name); // var processor = ActivatorUtilities.GetServiceOrCreateInstance(services, targetType) as IBackgroundTaskProcessor; // processor?.Process(taskInstance); //} }
public static void ShinyFinishedLaunching(this UIApplicationDelegate app, IShinyStartup?startup = null) => ShinyHost.Init(new ApplePlatform(), startup);
public static void ShinyInit(this Windows.UI.Xaml.Application app, IShinyStartup?startup = null) => ShinyHost.Init(new UwpPlatform(app), startup);
public static void ShinyInit <TBgTask>(this Windows.UI.Xaml.Application app, IShinyStartup startup) where TBgTask : IBackgroundTask { UwpPlatform.SetBackgroundTask(typeof(TBgTask)); ShinyHost.Init(new UwpPlatform(app), startup); }
public static void ShinyOnCreate(this Application application, IShinyStartup?startup = null) => ShinyHost.Init(new AndroidPlatform(application), startup);