public async Task RemoveSticker(StickerResponse sticker)
 {
     using (var ds = new StickersDataSource())
     {
         await ds.StickersRepository.Remove(sticker);
     }
 }
 public async Task <int> InsertSticker(StickerResponse sticker)
 {
     using (var ds = new StickersDataSource())
     {
         return(await ds.StickersRepository.Create(sticker));
     }
 }
 public async Task RemoveStickers()
 {
     using (var ds = new StickersDataSource())
     {
         await ds.StickersRepository.RemoveAll();
     }
 }
 public async Task <List <StickerResponse> > GetStickers()
 {
     using (var ds = new StickersDataSource())
     {
         return(await ds.StickersRepository.GetAllWithChildren());
     }
 }
 public async Task <int> InsertStickers(List <StickerResponse> stickers)
 {
     using (var ds = new StickersDataSource())
     {
         return(await ds.StickersRepository.CreateAll(stickers));
     }
 }
 public async Task RemoveSticker(StickerResponse sticker)
 {
     using (var ds = new StickersDataSource())
     {
         await ds.StickersRepository.Remove(sticker);
     }
 }
 public async Task RemoveStickers()
 {
     using (var ds = new StickersDataSource(Platform, DbLocation))
     {
         await ds.StickersRepository.RemoveAll();
     }
 }
 public async Task<int> InsertSticker(StickerResponse sticker)
 {
     using (var ds = new StickersDataSource())
     {
         return await ds.StickersRepository.Create(sticker);
     }
 }
 public async Task RemoveStickers()
 {
     using (var ds = new StickersDataSource())
     {
         await ds.StickersRepository.RemoveAll();
     }
 }
 public async Task<int> InsertStickers(List<StickerResponse> stickers)
 {
     using (var ds = new StickersDataSource())
     {
         return await ds.StickersRepository.CreateAll(stickers);
     }
 }
 public async Task<List<StickerResponse>> GetStickers()
 {
     using (var ds = new StickersDataSource())
     {
         return await ds.StickersRepository.GetAllWithChildren();
     }
 }
 public async Task RemoveStickers()
 {
     using (var ds = new StickersDataSource(Platform, DbLocation))
     {
         await ds.StickersRepository.RemoveAll();
     }
 }
Пример #13
0
        public App()
        {
            Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync();
            InitializeComponent();

            #region App settings

            Settings = SettingsService.Instance;
            //RequestedTheme = _settings.AppTheme;

            #endregion

            #region Database
            var db = new UserAccountDataSource(new SQLitePlatformWinRT(), DatabaseWinRTHelpers.GetWinRTDatabasePath(StringConstants.UserDatabase));
            db.CreateDatabase();

            var dbs = new StickersDataSource(new SQLitePlatformWinRT(), DatabaseWinRTHelpers.GetWinRTDatabasePath(StringConstants.StampDatabase));
            dbs.CreateDatabase();
            #endregion  
        }
Пример #14
0
        /// <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()
        {
            Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
                Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
                Microsoft.ApplicationInsights.WindowsCollectors.Session);
            this.InitializeComponent();
            this.Suspending += OnSuspending;
            Container = AutoFacConfiguration.Configure();

            try
            {
                StickersDataSource bs = new StickersDataSource();
                UserAccountDataSource ds = new UserAccountDataSource();
                ds.InitDatabase();
                ds.CreateDatabase();
                bs.InitDatabase();
                bs.CreateDatabase();
            }
            catch(Exception ex)
            {
            }
           
        }