private void AddBindingComponentsIfRequired() { if (m_bindingComponentsAlreadyAdded) { return; } m_bindingComponentsAlreadyAdded = true; // Create compoennts addressBook = AddComponentBasedOnPlatform <AddressBook>(); networkConnectivity = AddComponentBasedOnPlatform <NetworkConnectivity>(); sharing = AddComponentBasedOnPlatform <Sharing>(); userInterface = AddComponentBasedOnPlatform <UI>(); utility = AddComponentBasedOnPlatform <Utility>(); #if !NATIVE_PLUGINS_LITE_VERSION billing = AddComponentBasedOnPlatform <Billing>(); mediaLibrary = AddComponentBasedOnPlatform <MediaLibrary>(); notificationService = AddComponentBasedOnPlatform <NotificationService>(); twitter = AddComponentBasedOnPlatform <Twitter>(); webview = AddComponentBasedOnPlatform <WebViewNative>(); gameServices = AddComponentBasedOnPlatform <GameServices>(); #endif }
private async void processData() { string username = this.UsernameTextBox.Text; string password = this.passwordTextBox.Text; AppRepo repo = new AppRepo(); if (NetworkConnectivity.DnsTest()) { isBusy(true); var data = await repo.loginUser(new LoginDataModel { email = username, password = password }); if (data != null && data.status) { DatabaseOperations.saveToken(data); this.Hide(); var mainform = new MainForm(); mainform.Closed += (s, args) => this.Close(); mainform.Show(); } else { isBusy(false); errorProvider1.SetError(this.UsernameTextBox, "Login was not successful. Try again later"); return; } } else { MessageBox.Show(Constants.INTERNET_CONNECTION_ERR_MSG, Constants.INTERNET_CONNECTION_ERROR); return; } }
protected override void Awake() { base.Awake(); // Not interested in non singleton instance if (instance != this) { return; } // Create instances m_addressBook = AddComponentBasedOnPlatform <AddressBook>(); m_networkConnectivity = AddComponentBasedOnPlatform <NetworkConnectivity>(); m_sharing = AddComponentBasedOnPlatform <Sharing>(); m_UI = AddComponentBasedOnPlatform <UI>(); m_utility = AddComponentBasedOnPlatform <Utility>(); #if !NATIVE_PLUGINS_LITE_VERSION m_billing = AddComponentBasedOnPlatform <Billing>(); m_mediaLibrary = AddComponentBasedOnPlatform <MediaLibrary>(); m_notificationService = AddComponentBasedOnPlatform <NotificationService>(); m_twitter = AddComponentBasedOnPlatform <Twitter>(); m_webView = AddComponentBasedOnPlatform <WebViewNative>(); #endif }
public void Start() { _server = NetworkConnectivity.CreateTCPServerChannel("server"); _server.ChannelClientConnected += new ServerConnectionEventHandler(_server_ChannelClientConnected); _server.ChannelClientDisconnected += new ServerConnectionEventHandler(_server_ChannelClientDisconnected); //_server.ChannelConnected += //_server.ChannelDisconnected += _server.DataReceived += new ServerDataEventHandler(_server_DataReceived); //_server.DataSent += //_server.ExceptionOccurred += _server.ExceptionOccurred += new System.IO.ErrorEventHandler(_server_ExceptionOccurred); _server.Connect(_serviceport); }
public void Start() { server = NetworkConnectivity.CreateTCPServerChannel("server"); server.ChannelClientConnected += server_ChannelClientConnected; server.ChannelClientDisconnected += server_ChannelClientDisconnected; //_server.ChannelConnected += //_server.ChannelDisconnected += server.DataReceived += server_DataReceived; //_server.DataSent += //_server.ExceptionOccurred += server.ExceptionOccurred += server_ExceptionOccurred; server.Connect(servicePort); }
private async void loadDataFromServer() { if (NetworkConnectivity.DnsTest()) { isBusy(true); FoodItemsDataModel data = await getDatafromServerAsync(); isBusy(false); if (data != null && data.status && data.results != null) { populateDataFromServer(data.results); DatabaseOperations.addData(data.results); } } else { MessageBox.Show(Constants.INTERNET_CONNECTION_ERR_MSG, Constants.INTERNET_CONNECTION_ERROR); } }
public bool Start() { bool success = false; server = NetworkConnectivity.CreateTcpServerChannel("server"); try { server.Connect(servicePort); server.ChannelClientConnected += server_ChannelClientConnected; server.ChannelClientDisconnected += server_ChannelClientDisconnected; server.DataReceived += server_DataReceived; server.ExceptionOccurred += server_ExceptionOccurred; success = true; } catch (Exception e) { MigService.Log.Error(e); } return(success); }
protected override void Init() { base.Init(); // Not interested in non singleton instance if (instance != this) { return; } // Create compoennts #if USES_ADDRESS_BOOK if (addressBook == null) { addressBook = AddComponentBasedOnPlatformOnlyIfRequired <AddressBook>(); } #endif #if USES_BILLING if (billing == null) { billing = AddComponentBasedOnPlatformOnlyIfRequired <Billing>(); } #endif #if USES_CLOUD_SERVICES if (cloudServices == null) { cloudServices = AddComponentBasedOnPlatformOnlyIfRequired <CloudServices>(); } #endif #if USES_GAME_SERVICES if (gameServices == null) { gameServices = AddComponentBasedOnPlatformOnlyIfRequired <GameServices>(); } #endif #if USES_MEDIA_LIBRARY if (mediaLibrary == null) { mediaLibrary = AddComponentBasedOnPlatformOnlyIfRequired <MediaLibrary>(); } #endif #if USES_NETWORK_CONNECTIVITY if (networkConnectivity == null) { networkConnectivity = AddComponentBasedOnPlatformOnlyIfRequired <NetworkConnectivity>(); } #endif #if USES_NOTIFICATION_SERVICE if (notificationService == null) { notificationService = CachedGameObject.AddComponentIfNotFound <NotificationService>(); } #endif #if USES_SHARING if (sharing == null) { sharing = AddComponentBasedOnPlatformOnlyIfRequired <Sharing>(); } #endif #if USES_TWITTER if (twitter == null) { twitter = AddComponentBasedOnPlatformOnlyIfRequired <Twitter>(); } #endif if (userInterface == null) { userInterface = AddComponentBasedOnPlatformOnlyIfRequired <UI>(); } if (utility == null) { utility = CachedGameObject.AddComponentIfNotFound <Utility>(); } #if USES_WEBVIEW if (webview == null) { webview = CachedGameObject.AddComponentIfNotFound <WebViewNative>(); } #endif #if USES_SOOMLA_GROW if (soomlaGrowService == null) { soomlaGrowService = AddComponentBasedOnPlatformOnlyIfRequired <SoomlaGrowService>(); } #endif }