/// <summary> /// Constructs a new property with the given name and property type. /// </summary> /// <param name="name">The name of the property.</param> /// <param name="propType"></param> public DatabaseProperty(string name, ControlDisplayType propType, Type establishedType) { var inferred = BindingUtility.InferTypeFromPropType(propType); if (establishedType != inferred && !establishedType.IsSubclassOf(inferred)) { throw new ArgumentException("The established type '" + establishedType + "' is not compatible with the property type '" + propType.ToString() + "'."); } _Name = name; _PropType = propType; _EstablishedType = establishedType; }