/// <summary> /// Restore mobeelizer applicaion state after tombstoning. /// Execute this method in your App.xaml.cs when application is activated. /// </summary> /// <param name="isApplicationInstancePreserved">Indicates whether yuours application instance is preserved.</param> public static void OnActivated(bool isApplicationInstancePreserved) { if (!isApplicationInstancePreserved) { Instance = MobeelizerApplication.CreateApplication(); Instance.SyncStatusChanged += OnSyncStatusChanged; Instance.GetTombstoningManager().RestoreApplicationState(); } Instance.GetTombstoningManager().ClearSavedState(); }
internal MobeelizerFileService(MobeelizerApplication application) { this.application = application; }
public MobeelizerSyncServicePerformer(MobeelizerApplication application, bool syncAll) { this.application = application; this.isAllSynchronization = syncAll; this.dataFileService = new MobeelizerDataFileService(application); }
internal static MobeelizerApplication CreateApplication() { MobeelizerApplication application = new MobeelizerApplication(); application.tombstoningManager = new MobeelizerTombstoningManager(application); MobeelizerConfigurationSection section = (MobeelizerConfigurationSection)ConfigurationManager.GetSection("mobeelizer-configuration"); if (section == null) { throw new ConfigurationException("'mobeelizer-configuration' section not found in app.config file. Check if app.config is not missing and if file Build Action is set to Content."); } String device; String entityPackage; String definitionXml; String developmentRole; String url; String stringMode; int databaseVersion = 1; try { device = section.AppSettings[META_DEVICE].Value; } catch (KeyNotFoundException) { throw new ConfigurationException(META_DEVICE + " must be set in app.config file."); } try { entityPackage = section.AppSettings[META_PACKAGE].Value; } catch (KeyNotFoundException) { throw new ConfigurationException(META_PACKAGE + " must be set in app.config file."); } try { definitionXml = section.AppSettings[META_DEFINITION_ASSET].Value; } catch (KeyNotFoundException) { definitionXml = "application.xml"; } try { developmentRole = section.AppSettings[META_DEVELOPMENT_ROLE].Value; } catch (KeyNotFoundException) { developmentRole = null; } try { String strDatabaseVersion = section.AppSettings[META_DATABASE_VERSION].Value; if (!Int32.TryParse(strDatabaseVersion, out databaseVersion)) { throw new ConfigurationException(META_DATABASE_VERSION + " must be natural number."); } } catch (KeyNotFoundException) { databaseVersion = 1; } try { url = section.AppSettings[META_URL].Value; } catch (KeyNotFoundException) { url = null; } try { stringMode = section.AppSettings[META_MODE].Value; } catch (KeyNotFoundException) { throw new ConfigurationException(META_MODE + " must be set in app.config file."); } application.initApplication(device, entityPackage, developmentRole, definitionXml, databaseVersion, url, stringMode); return application; }
private void SetRoleAndInstanceGuidInDatabase(MobeelizerApplication application, string role, string instanceGuid) { application.InternalDatabase.SetRoleAndInstanceGuid(application.Instance, application.User, application.Password, role, instanceGuid); }
private string[] GetRoleAndInstanceGuidFromDatabase(MobeelizerApplication application) { return application.InternalDatabase.GetRoleAndInstanceGuid(application.Instance, application.User, application.Password); }
private void ClearRoleAndInstanceGuidInDatabase(MobeelizerApplication application) { application.InternalDatabase.ClearRoleAndInstanceGuid(application.Instance, application.User); }
private bool IsInitialSyncRequired(MobeelizerApplication application, string instanceGuid) { return(application.InternalDatabase.IsInitialSyncRequired(application.Instance, instanceGuid, application.User)); }
public MobeelizerRealConnectionManager(MobeelizerApplication application) { this.application = application; this.connectionService = new MobeelizerConnectionService(application); }
private string[] GetRoleAndInstanceGuidFromDatabase(MobeelizerApplication application) { return(application.InternalDatabase.GetRoleAndInstanceGuid(application.Instance, application.User, application.Password)); }
public MobeelizerDataFileService(MobeelizerApplication application) { this.application = application; }
/// <summary> /// Initialize mobeelizer application. Execute this method in your App.xaml.cs when application is lounching. /// </summary> public static void OnLaunching() { Instance = MobeelizerApplication.CreateApplication(); Instance.SyncStatusChanged += OnSyncStatusChanged; Instance.GetTombstoningManager().ClearAndUnlockSavedState(); }
internal MobeelizerTombstoningManager(MobeelizerApplication application) { this.application = application; }
private bool IsInitialSyncRequired(MobeelizerApplication application, string instanceGuid) { return application.InternalDatabase.IsInitialSyncRequired(application.Instance, instanceGuid, application.User); }
internal static MobeelizerApplication CreateApplication() { MobeelizerApplication application = new MobeelizerApplication(); application.tombstoningManager = new MobeelizerTombstoningManager(application); MobeelizerConfigurationSection section = (MobeelizerConfigurationSection)ConfigurationManager.GetSection("mobeelizer-configuration"); if (section == null) { throw new ConfigurationException("'mobeelizer-configuration' section not found in app.config file. Check if app.config is not missing and if file Build Action is set to Content."); } String device; String entityPackage; String definitionXml; String developmentRole; String url; String stringMode; int databaseVersion = 1; try { device = section.AppSettings[META_DEVICE].Value; } catch (KeyNotFoundException) { throw new ConfigurationException(META_DEVICE + " must be set in app.config file."); } try { entityPackage = section.AppSettings[META_PACKAGE].Value; } catch (KeyNotFoundException) { throw new ConfigurationException(META_PACKAGE + " must be set in app.config file."); } try { definitionXml = section.AppSettings[META_DEFINITION_ASSET].Value; } catch (KeyNotFoundException) { definitionXml = "application.xml"; } try { developmentRole = section.AppSettings[META_DEVELOPMENT_ROLE].Value; } catch (KeyNotFoundException) { developmentRole = null; } try { String strDatabaseVersion = section.AppSettings[META_DATABASE_VERSION].Value; if (!Int32.TryParse(strDatabaseVersion, out databaseVersion)) { throw new ConfigurationException(META_DATABASE_VERSION + " must be natural number."); } } catch (KeyNotFoundException) { databaseVersion = 1; } try { url = section.AppSettings[META_URL].Value; } catch (KeyNotFoundException) { url = null; } try { stringMode = section.AppSettings[META_MODE].Value; } catch (KeyNotFoundException) { throw new ConfigurationException(META_MODE + " must be set in app.config file."); } application.initApplication(device, entityPackage, developmentRole, definitionXml, databaseVersion, url, stringMode); return(application); }