Esempio n. 1
0
        public App()
        {
            InitializeComponent();

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

            //MSSqlServer

            //string connectionString = MSSqlConnectionProvider.GetConnectionString("YOUR_SERVER_NAME", "sa", "", "XamarinDemo");

            //SQLite

            //var filePath = Path.Combine(documentsPath, "xpoXamarinDemo.db");
            //string connectionString = SQLiteConnectionProvider.GetConnectionString(filePath) + ";Cache=Shared;";

            //In-memory data store with saving/loading from the xml file

            var    filePath         = Path.Combine(documentsPath, "xpoXamarinDemo.xml");
            string connectionString = InMemoryDataStore.GetConnectionString(filePath);

            XpoHelper.InitXpo(connectionString);


            if (Device.RuntimePlatform == Device.iOS)
            {
                MainPage = new MainPage();
            }
            else
            {
                MainPage = new NavigationPage(new MainPage());
            }
        }
 static void Main()
 {
     XpoDefault.ConnectionString = InMemoryDataStore.GetConnectionString(@"..\..\data.xml");
     CreateData();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     SkinManager.EnableFormSkins();
     Application.Run(new Form1());
 }
Esempio n. 3
0
        public override void Configure(IFunctionsHostBuilder builder)
        {
            //Database = new ExposureNotificationStorage(
            //	builder => builder.UseInMemoryDatabase("ChangeInProduction"),
            //	initialize => initialize.Database.EnsureCreated());



            Database = new XpoExposureNotificationStorage(InMemoryDataStore.GetConnectionString("Data.xml"));
        }
Esempio n. 4
0
        public TestsXpo()
        {
            //Storage = new ExposureNotificationStorage(
            //	builder => builder.UseInMemoryDatabase("Tests"),
            //	initialize => initialize.Database.EnsureCreated());
            //XpoProvider=MSSqlServer;Data Source=(local);User ID=username;Password=password;Initial Catalog=database;Persist Security Info=true

            //Storage = new XpoExposureNotificationStorage("XpoProvider=MSSqlServer;Data Source=DESKTOP-D0MDBF3;User ID=sa;Password=123;Initial Catalog=XpoStorage;Persist Security Info=true");
            //Storage = new XpoExposureNotificationStorage(InMemoryDataStore.GetConnectionStringInMemory(true));

            Storage = new XpoExposureNotificationStorage(InMemoryDataStore.GetConnectionString("Data.xml"));
        }
        void InitDataLayers()
        {
            string metadataFileName = "Metadata.xml";
            string dataFileName     = "Data.mdb";

            if (File.Exists(metadataFileName))
            {
                File.Delete(metadataFileName);
            }
            if (File.Exists(dataFileName))
            {
                File.Delete(dataFileName);
            }

            metadataStorage = XpoDefault.GetDataLayer(InMemoryDataStore.GetConnectionString(metadataFileName), AutoCreateOption.DatabaseAndSchema);
            dataStorage     = XpoDefault.GetDataLayer(AccessConnectionProvider.GetConnectionString(dataFileName), AutoCreateOption.DatabaseAndSchema);
        }