Inheritance: ISQLitePlatform
コード例 #1
0
		private void SetUpConnection()
		{
			var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, "sqlite.db");
			var plat = new SQLitePlatformWinRT();

			var connectionFactory =
				new Func<SQLiteConnectionWithLock>(
					() => new SQLiteConnectionWithLock(plat, new SQLiteConnectionString(path, false)));
			_asyncConnection = new SQLiteAsyncConnection(connectionFactory);
		}
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: Yanpix/FinanceManager
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();

            platform = new SQLitePlatformWinRT();

            iocContainer = new UnityContainer();

            DependencyResolver.RegisterTypes(iocContainer);

            this.Suspending += this.OnSuspending;
        }
コード例 #3
0
ファイル: 39.cs プロジェクト: RobGibbens/CodeStock
        public SQLiteAsyncConnection GetConnection()
        {
            const string sqliteFilename = "Conferences.db3";

            var path = Path.Combine(ApplicationData.Current.LocalFolder.Path, sqliteFilename);

            var platform = new SQLitePlatformWinRT();

            var connectionWithLock = new SQLiteConnectionWithLock(
                                          platform,
                                          new SQLiteConnectionString(path, true));

            var connection = new SQLiteAsyncConnection(() => connectionWithLock);

            return connection;
        }
コード例 #4
0
		public async Task<ConnectionInfo<SQLiteAsyncConnection>> GetConnection()
		{
			ConnectionInfo<SQLiteAsyncConnection> connectionInfo = new ConnectionInfo<SQLiteAsyncConnection>();
			connectionInfo.IsInitializedDbStructure = true;

			var sqliteFilename = XamarinSocialApp.UI.Common.Implementations.Constants.Constants.Configuration.csLocalDbFileName;
			string path = Path.Combine(ApplicationData.Current.LocalFolder.Path, sqliteFilename);

			if (!await FileExists(path))
			{
				connectionInfo.IsInitializedDbStructure = false;
			}

			var plat = new SQLitePlatformWinRT();
			var connectionFactory = new Func<SQLiteConnectionWithLock>(() =>
				new SQLiteConnectionWithLock(plat, new SQLiteConnectionString(path, storeDateTimeAsTicks: false)));
			var asyncConnection = new SQLiteAsyncConnection(connectionFactory);
			connectionInfo.Connection = asyncConnection;

			return connectionInfo;
		}
コード例 #5
0
ファイル: App.xaml.cs プロジェクト: Yanpix/FinanceManager
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += this.OnSuspending;

            databaseName = "FinanceManager.sqlite";
            databasePath = Path.Combine(ApplicationData.Current.LocalFolder.Path, databaseName);
            platform = new SQLitePlatformWinRT();
            container = UnityConfig.Container;

            if (!DatabaseExists(databaseName).Result)
            {
                _dataInitService = container.Resolve<IDataInitService>();
                _dataInitService.Initialize();
            }

            _currencyRateService = container.Resolve<ICurrencyRatesService>();

            _dataInitService = container.Resolve<IDataInitService>();
            _dataInitService.CheckReportingPeriods();

            _currencyRateService.UpdateExchangeRates();
        }
コード例 #6
0
ファイル: Database.cs プロジェクト: dmitry-osin/Drugs.WP8.1
 public Database()
 {
     SqLitePlatform = new SQLitePlatformWinRT();
 }