async Task ExecuteLoadItemsCommand() { if (LoadItemsIsBusy) { return; } LoadItemsIsBusy = true; try { Items.Clear(); var items = await MainTableDataStore.GetItemsAsync(true); foreach (var item in items) { Items.Add(item); } } catch (Exception ex) { LogsHandler.WriteException(ex); } finally { LoadItemsIsBusy = false; } }
static Repository() { try { me = new Repository(); } catch (Exception Ex) { LogsHandler.WriteException(Ex); } }
/// <summary> /// Initializes a new instance of the Database. /// if the database doesn't exist, it will create the database and all the tables. /// </summary> /// <param name='path'> /// Path. /// </param> public Database(string path) : base(path, true, "Password") { try { LogsHandler.WriteDebug("CreateTable MainTable"); // create the tables CreateTable <DataAccessLayer.Models.Tables.MainTable>(); } catch (Exception Ex) { LogsHandler.WriteException(Ex); } }
protected Repository() { try { LogsHandler.WriteDebug("DataModel.DAL.Repository: Initiate Repository"); // set the db location dbLocation = DatabaseFilePath; // instantiate the database db = new DL.Database(dbLocation); } catch (Exception Ex) { LogsHandler.WriteException(Ex); } }