namespace DatabaseExport { /// /// generic base class for settings /// public abstract class Setting { protected string _propertyId; /// /// string id of property /// public string PropertyId => _propertyId; protected int _propertyType; // /// // /// type of property (global or user specific) // /// // public PropertyTypes PropertyType { get { return (PropertyTypes)_propertyType; } } protected string _propertyValue; /// /// value of property /// does not currently do length checking and there is a max length /// public string PropertyValue => _propertyValue; protected string _userId; // /// // /// User for user specific settings // /// // public string UserId { get { return _userId; } } public enum PropertyTypes { User = 1 << 0, Global = 1 << 1 } public Setting(string id, PropertyTypes type, string defaultPropertyValue, string userId) { _userId = userId; _propertyId = id; _propertyType = (int)type; GetPropertyValue(defaultPropertyValue); } protected abstract void GetPropertyValue(string defaultValue); public void SetValue(string value) { _propertyValue = value; //StoreInDB(); } } }