Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }