Ejemplo n.º 1
0
        /// <summary>
        /// Sets <see cref="EntitySchema"/> property <paramref name="propertyName"/> enabled.
        /// </summary>
        /// <param name="item"><see cref="ISchemaManagerItem"/> implementation instance.</param>
        /// <param name="propertyName"><see cref="EntitySchema"/> property name.</param>
        private void SetEntitySchemaPropertyEnabled(ISchemaManagerItem <EntitySchema> item, string propertyName)
        {
            if (item == null)
            {
                return;
            }
            var designItem = GetDesignItem(item);

            if (!designItem.Instance.HasProperty(propertyName))
            {
                return;
            }
            var propertyValue = designItem.Instance.GetPropertyValue(propertyName) as bool?;

            if (!propertyValue.HasValue || propertyValue.Value)
            {
                return;
            }
            designItem.Instance.SetPropertyValue(propertyName, true);
            _entitySchemaManager.SaveSchema(designItem, _userConnection);
        }