Exemplo n.º 1
0
 /// <summary>
 /// Removes the given property from this definition.
 /// </summary>
 /// <param name="prop">The property to remove.</param>
 public void RemoveProperty(DatabaseProperty prop)
 {
     if (_PropertiesList.Remove(prop))
     {
         _Version++;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a new property of the given type to this definition.
        /// </summary>
        /// <param name="controlType">The type of property to add.</param>
        /// <param name="propertyName">Optional name to give to the property that will be created.</param>
        /// <returns>A reference to the newly created property.</returns>
        public DatabaseProperty AddProperty(ControlDisplayType controlType, Type dataType, string propertyName = null)
        {
            _Version++;
            if (string.IsNullOrEmpty(propertyName))
            {
                propertyName = "New Property";
            }
            var prop = new DatabaseProperty(Database.GenerateUniqueName(propertyName, AllPropertyNames), controlType, dataType);

            Properties.Add(prop);
            return(prop);
        }