public bool Add(DBConfigEntry entry) { //Add a new configuration entry bool bRet = false; try { bRet = entry.Create(); } catch (Exception ex) { throw new ApplicationException("Unexpected error adding configuration entry.", ex); } return(bRet); }
public bool Remove(DBConfigEntry entry) { //Remove the specified configuration entry bool bRet = false; try { bRet = entry.Delete(); } catch (Exception ex) { throw new ApplicationException("Unexpected error removing configuration entry.", ex); } return(bRet); }
public DBConfigEntry Item() { //Return a new blank configuration entry object DBConfigEntry entry = null; try { entry = new DBConfigEntry(this.mMediator); entry.Application = this.mProductName; entry.Changed += new EventHandler(OnEntryChanged); } catch (Exception ex) { throw new ApplicationException("Unexpected error getting configuration entry.", ex); } return(entry); }
public DBConfigEntry Item(string pcName, string key) { //Return an existing entry object from the database entries collection DBConfigEntry entry = null; try { //Merge from collection (dataset) if (pcName != "" && key != "") { AppConfigDS.ConfigTableRow row = (AppConfigDS.ConfigTableRow) this.mConfigEntries.ConfigTable.Select("Application='" + this.mProductName + "'" + " AND PCName='" + pcName + "'" + " AND Key='" + key + "'")[0]; entry = new DBConfigEntry(row, this.mMediator); entry.Changed += new EventHandler(OnEntryChanged); } else { entry = Item(); } } catch (Exception ex) { throw new ApplicationException("Unexpected error getting configuration entry.", ex); } return(entry); }