コード例 #1
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            #if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
            #endif

            // <Fake ioc>
            Container.Track = new IOSTrack();
            IFileStore     fileStore     = new IOSFileStore();
            ICacheHost     cacheHost     = new CacheHost(NativeAssumptions.INTERNAL_APP_NAME);
            IViewPlatform  viewPlatform  = new IOSViewPlatform();
            IDataCache     dataCache     = new DataCache(cacheHost);
            IStencilApp    stencilApp    = new StencilApp(viewPlatform, cacheHost, dataCache, NativeAssumptions.BASE_API_URL);
            IMediaUploader mediaUploader = new IOSMediaUploader();
            Container.RegisterDependencies(fileStore, cacheHost, dataCache, stencilApp, viewPlatform, mediaUploader);
            // </Fake ioc>


            Container.StencilApp.Initialize();

            NSObject notification = null;
            if (launchOptions != null)
            {
                notification = launchOptions.ObjectForKey(UIApplication.LaunchOptionsRemoteNotificationKey);
            }

            if (notification != null)
            {
                //TODO:COULD: Track notification source
            }


            this.InitializeThemes();
            this.InitializeEnvironment();

            this.MainStoryboard = UIStoryboard.FromName("MainStoryboard", null);

            this.Window = new UIWindow(UIScreen.MainScreen.Bounds);


            if (stencilApp.CurrentAccount == null)
            {
                this.LaunchLogin();
            }
            else
            {
                this.LaunchLogin(); //TODO:MUST: Support forked launching
                // make your own launch____ (ie: Launchdashboard)
            }

            this.Window.MakeKeyAndVisible();

            return(true);
        }
コード例 #2
0
        public StencilApplication(IntPtr handle, JniHandleOwnership transfer)
            : base(handle, transfer)
        {
            // <Fake ioc>
            IFileStore    fileStore    = new AndroidFileStore(this);
            ICacheHost    cacheHost    = new CacheHost(NativeAssumptions.INTERNAL_APP_NAME);
            IViewPlatform viewPlatform = new AndroidViewPlatform(this);
            IDataCache    dataCache    = new DataCache(cacheHost);
            IStencilApp   stencilApp   = new StencilApp(viewPlatform, cacheHost, dataCache, NativeAssumptions.BASE_API_URL);

            Container.RegisterDependencies(fileStore, cacheHost, dataCache, stencilApp, viewPlatform, null);
            // </Fake ioc>

            Container.StencilApp.Initialize();

            this.StartServices();
        }