コード例 #1
0
        public virtual ISQLiteAsyncConnection CreateConnection(string dbName)
        {
            ILocalStorageService storageService           = ServiceProvider.GetService <ILocalStorageService>();
            IActivatorService    activatorService         = ServiceProvider.GetService <IActivatorService>();
            Func <string, ISQLiteAsyncConnection> factory = activatorService.CreateInstance <Func <string, ISQLiteAsyncConnection> >();
            ISQLiteAsyncConnection db = factory(storageService.GetFilePath(dbName, LocalFolderKind.Data));

            return(db);
        }
コード例 #2
0
        protected override void OnStart(StartParameter parameter)
        {
            base.OnStart(parameter);

            ISQLiteService         service    = ServiceProvider.GetService <ISQLiteService>();
            ISQLiteAsyncConnection connection = service.OpenDefaultConnection();

            if (!connection.Connection.TableExists <Property>())
            {
                connection.CreateTableAsync <Property>();
            }

            if (!connection.Connection.TableExists <RecentSearch>())
            {
                connection.CreateTableAsync <RecentSearch>();
            }

            // Set the root ViewModel to be displayed at startup
            this.SetRootViewModel <PropertySearchViewModel>();
        }
コード例 #3
0
 public RequestHistory(ISQLiteAsyncConnection sqlite)
 {
     this.sqlite = sqlite;
 }