public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // <Fake ioc> ICacheFileStore fileStore = new IOSFileStore(); ICacheHost cacheHost = new CacheHost(CoreAssumptions.INTERNAL_APP_NAME); IViewPlatform viewPlatform = new IOSViewPlatform(); IEscapeApp escapeApp = new EscapeApp(cacheHost, viewPlatform); Container.RegisterDependencies(fileStore, cacheHost, escapeApp, viewPlatform); // </Fake ioc> Container.EscapeApp.Initialize(); this.InitializeEnvironment(); this.MainStoryboard = UIStoryboard.FromName("MainStoryboard", null); this.Window = new UIWindow(UIScreen.MainScreen.Bounds); if (launchOptions != null && launchOptions.ContainsKey(UIApplication.LaunchOptionsLocalNotificationKey)) { UILocalNotification localNotification = launchOptions[UIApplication.LaunchOptionsLocalNotificationKey] as UILocalNotification; this.LaunchNotification(localNotification, true); } else { this.LaunchMain(); } this.Window.MakeKeyAndVisible(); return(true); }
private void Application_BeginRequest(Object source, EventArgs e) { var app = (HttpApplication)source; var context = app.Context; Host = CacheHost.Initialize(context); }
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); }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter // <Fake ioc> Container.Track = new CoreTrack(); ICacheFileStore fileStore = new WindowsFileStore(); ICacheHost cacheHost = new CacheHost(CoreAssumptions.INTERNAL_APP_NAME); IViewPlatform viewPlatform = new WindowsViewPlatform(); IEscapeApp escapeApp = new EscapeApp(cacheHost, viewPlatform); Container.RegisterDependencies(fileStore, cacheHost, escapeApp, viewPlatform); // </Fake ioc> Container.EscapeApp.Initialize(); rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); }
public EscapeApplication(IntPtr handle, JniHandleOwnership transfer) : base(handle, transfer) { // <Fake ioc> ICacheFileStore fileStore = new AndroidFileStore(this); ICacheHost cacheHost = new CacheHost(CoreAssumptions.INTERNAL_APP_NAME); IViewPlatform viewPlatform = new AndroidViewPlatform(this); IEscapeApp escapeApp = new EscapeApp(cacheHost, viewPlatform); Container.RegisterDependencies(fileStore, cacheHost, escapeApp, viewPlatform); // </Fake ioc> // Simple bootstrap Container.EscapeApp.Initialize(); }
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(); }
/// <summary> /// Set things in motion so your service can do its work. /// </summary> protected override void OnStart(string[] args) { try { int serverPort = SocketServer.SocketServer.DEFAULT_SOCK_SERVER_PORT; int sendBuffer = SocketServer.SocketServer.DEFAULT_SOCK_BUFFER_SIZE; int receiveBuffer = SocketServer.SocketServer.DEFAULT_SOCK_BUFFER_SIZE; int managementServerPort = SocketServer.SocketServer.DEFAULT_MANAGEMENT_PORT; //Numan Hanif: in case of compact serilization plus DS Provider in same dll we search in deploy dir brute forcely AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(Common.Util.AssemblyResolveEventHandler.DeployAssemblyHandler); try { string configPort = ConfigurationSettings.AppSettings["NCacheServer.Port"]; if (configPort.Length > 0) { serverPort = Convert.ToInt32(configPort); } string managePort = ConfigurationSettings.AppSettings["NCacheServer.ManagementPort"]; if (managePort.Length > 0) { managementServerPort = Convert.ToInt32(managePort); } string configSendBuffer = ConfigurationSettings.AppSettings["NCacheServer.SendBufferSize"]; if (configSendBuffer.Length > 0) { sendBuffer = Convert.ToInt32(configSendBuffer); } string configReceiveBuffer = ConfigurationSettings.AppSettings["NCacheServer.ReceiveBufferSize"]; if (configReceiveBuffer.Length > 0) { receiveBuffer = Convert.ToInt32(configReceiveBuffer); } } catch (Exception) { } _nchost = new CacheHost(); _socketServer = new SocketServer.SocketServer(serverPort, sendBuffer, receiveBuffer); try { int period = -1; string intervalString = ConfigurationSettings.AppSettings["GCCollectInterval"]; if (intervalString.Length > 0) { period = Convert.ToInt32(intervalString); } _socketServer.StartGCTimer(5, period); } catch (Exception) { } IPAddress clusterIp = null; if (_clusterIp != null && _clusterIp != string.Empty) { try { clusterIp = IPAddress.Parse(_clusterIp); } catch (Exception) { throw new Exception("Invalid BindToIP address specified"); } } ValidateMapAddress("NCacheServer.MgmtEndPoint"); ValidateMapAddress("NCacheServer.ServerEndPoint"); _nchost.RegisterMonitorServer(); //muds: //start the socket server separately. //Start the NCache Management socket server seperately _managementSocketServer = new SocketServer.SocketServer(managementServerPort, sendBuffer, receiveBuffer); _managementSocketServer.Start(clusterIp, Alachisoft.NCache.Common.Logger.LoggerNames.CacheManagementSocketServer, "NManagement Service", CommandManagerType.NCacheManagement); _socketServer.Start(clusterIp, Alachisoft.NCache.Common.Logger.LoggerNames.SocketServerLogs, "NCache Service", CommandManagerType.NCacheClient); CacheServer.SocketServerPort = managementServerPort; _nchost.CacheServer.SynchronizeClientConfig(); _nchost.CacheServer.ClusterIP = _clusterIp; _nchost.CacheServer.Renderer = _socketServer; Alachisoft.NCache.SocketServer.CacheProvider.Provider = _nchost.CacheServer; } catch (Exception ex) { AppUtil.LogEvent(_cacheserver, ex.ToString(), EventLogEntryType.Error, EventCategories.Error, EventID.GeneralError); throw ex; } }