コード例 #1
0
        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);
            //}
        }
コード例 #2
0
ファイル: iOSHooks.cs プロジェクト: moljac/shiny
 public static void ShinyFinishedLaunching(this UIApplicationDelegate app, IShinyStartup?startup = null)
 => ShinyHost.Init(new ApplePlatform(), startup);
コード例 #3
0
 public static void ShinyInit(this Windows.UI.Xaml.Application app, IShinyStartup?startup = null)
 => ShinyHost.Init(new UwpPlatform(app), startup);
コード例 #4
0
 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);
 }
コード例 #5
0
 public static void ShinyOnCreate(this Application application, IShinyStartup?startup = null)
 => ShinyHost.Init(new AndroidPlatform(application), startup);