/// <summary>
 ///     Sets facets on the property being created by the passed in command.
 /// </summary>
 /// <param name="prereq">Must be non-null command creating the conceptual property</param>
 /// <param name="theDefault">Optional facet</param>
 /// <param name="concurrencyMode">Optional facet</param>
 /// <param name="getterAccessModifier">Optional facet</param>
 /// <param name="setterAccessModifier">Optional facet</param>
 internal SetConceptualPropertyFacetsCommand(
     CreatePropertyCommand prereq, StringOrNone theDefault, string concurrencyMode, string getterAccessModifier,
     string setterAccessModifier, StringOrPrimitive <UInt32> maxLength, BoolOrNone fixedLength, StringOrPrimitive <UInt32> precision,
     StringOrPrimitive <UInt32> scale, BoolOrNone unicode, StringOrNone collation)
     : base(prereq, theDefault, maxLength, fixedLength, precision, scale, unicode, collation, concurrencyMode)
 {
     _getterAccessModifier = getterAccessModifier;
     _setterAccessModifier = setterAccessModifier;
 }
 /// <summary>
 ///     Sets facets on the property being created by the passed in command.
 /// </summary>
 /// <param name="prereq">Must be non-null command creating the conceptual property</param>
 /// <param name="theDefault">Optional facet</param>
 /// <param name="concurrencyMode">Optional facet</param>
 /// <param name="getterAccessModifier">Optional facet</param>
 /// <param name="setterAccessModifier">Optional facet</param>
 internal SetConceptualPropertyFacetsCommand(
     CreatePropertyCommand prereq, StringOrNone theDefault, string concurrencyMode, string getterAccessModifier,
     string setterAccessModifier, StringOrPrimitive<UInt32> maxLength, BoolOrNone fixedLength, StringOrPrimitive<UInt32> precision,
     StringOrPrimitive<UInt32> scale, BoolOrNone unicode, StringOrNone collation)
     : base(prereq, theDefault, maxLength, fixedLength, precision, scale, unicode, collation, concurrencyMode)
 {
     _getterAccessModifier = getterAccessModifier;
     _setterAccessModifier = setterAccessModifier;
 }
        /// <summary>
        ///     Sets facets on the passed in property.
        /// </summary>
        /// <param name="property">Must be a non-null storage property</param>
        /// <param name="theDefault">Optional facet</param>
        /// <param name="maxLength">Optional facet</param>
        /// <param name="fixedLength">Optional facet</param>
        /// <param name="precision">Optional facet</param>
        /// <param name="scale">Optional facet</param>
        /// <param name="unicode">Optional facet</param>
        /// <param name="collation">Optional facet</param>
        /// <param name="concurrencyMode">Optional facet</param>
        internal SetPropertyFacetsCommand(
            Property property, StringOrNone theDefault,
            StringOrPrimitive<UInt32> maxLength, BoolOrNone fixedLength, StringOrPrimitive<UInt32> precision,
            StringOrPrimitive<UInt32> scale, BoolOrNone unicode, StringOrNone collation, string concurrencyMode)
        {
            CommandValidation.ValidateProperty(property);

            _property = property;
            _theDefault = theDefault;
            _maxLength = maxLength;
            _fixedLength = fixedLength;
            _precision = precision;
            _scale = scale;
            _unicode = unicode;
            _collation = collation;
            _concurrencyMode = concurrencyMode;
        }
Пример #4
0
        /// <summary>
        ///     Sets facets on the passed in property.
        /// </summary>
        /// <param name="property">Must be a non-null storage property</param>
        /// <param name="theDefault">Optional facet</param>
        /// <param name="maxLength">Optional facet</param>
        /// <param name="fixedLength">Optional facet</param>
        /// <param name="precision">Optional facet</param>
        /// <param name="scale">Optional facet</param>
        /// <param name="unicode">Optional facet</param>
        /// <param name="collation">Optional facet</param>
        /// <param name="concurrencyMode">Optional facet</param>
        internal SetPropertyFacetsCommand(
            Property property, StringOrNone theDefault,
            StringOrPrimitive <UInt32> maxLength, BoolOrNone fixedLength, StringOrPrimitive <UInt32> precision,
            StringOrPrimitive <UInt32> scale, BoolOrNone unicode, StringOrNone collation, string concurrencyMode)
        {
            CommandValidation.ValidateProperty(property);

            _property        = property;
            _theDefault      = theDefault;
            _maxLength       = maxLength;
            _fixedLength     = fixedLength;
            _precision       = precision;
            _scale           = scale;
            _unicode         = unicode;
            _collation       = collation;
            _concurrencyMode = concurrencyMode;
        }
        /// <summary>
        ///     Creates a new property in the passed in storage entity and optionally sets additional
        ///     facets on the property.
        ///     NOTE: If the cpc already has an active transaction, these changes will be in that transaction
        ///     and the caller of this helper method must commit it to see these changes commited.
        /// </summary>
        /// <param name="cpc"></param>
        /// <param name="name">The name of the property</param>
        /// <param name="entityType">Must be a storage entity</param>
        /// <param name="type">The type to use for this property (cannot be empty)</param>
        /// <param name="nullable">Flag whether the property is nullable or not</param>
        /// <param name="theDefault">Optional: the default value for this property</param>
        /// <param name="maxLength">Optional facet</param>
        /// <param name="fixedLength">Optional facet</param>
        /// <param name="precision">Optional facet</param>
        /// <param name="scale">Optional facet</param>
        /// <param name="unicode">Optional facet</param>
        /// <param name="collation">Optional facet</param>
        /// <param name="concurrencyMode">Optional: the concurrency mode for this property</param>
        /// <returns>The new Property</returns>
        internal static Property CreateStorageProperty(
            CommandProcessorContext cpc, string name, StorageEntityType entityType,
            string type, bool?nullable, StringOrNone theDefault, StringOrPrimitive <UInt32> maxLength, BoolOrNone fixedLength,
            StringOrPrimitive <UInt32> precision,
            StringOrPrimitive <UInt32> scale, BoolOrNone unicode, StringOrNone collation, string concurrencyMode)
        {
            CommandValidation.ValidateStorageEntityType(entityType);

            var cpcd = new CreatePropertyCommand(name, entityType, type, nullable);
            var ssp  = new SetPropertyFacetsCommand(
                cpcd, theDefault, maxLength, fixedLength, precision, scale, unicode, collation, concurrencyMode);

            var cp = new CommandProcessor(cpc, cpcd, ssp);

            cp.Invoke();

            return(cpcd.CreatedProperty);
        }
Пример #6
0
        /// <summary>
        ///     Sets facets on the property being created by the passed in command.
        /// </summary>
        /// <param name="prereq">Must be non-null command creating the storage property</param>
        /// <param name="theDefault">Optional facet</param>
        /// <param name="maxLength">Optional facet</param>
        /// <param name="fixedLength">Optional facet</param>
        /// <param name="precision">Optional facet</param>
        /// <param name="scale">Optional facet</param>
        /// <param name="unicode">Optional facet</param>
        /// <param name="collation">Optional facet</param>
        /// <param name="concurrencyMode">Optional facet</param>
        internal SetPropertyFacetsCommand(
            CreateComplexTypePropertyCommand prereq, StringOrNone theDefault,
            StringOrPrimitive <UInt32> maxLength, BoolOrNone fixedLength, StringOrPrimitive <UInt32> precision,
            StringOrPrimitive <UInt32> scale, BoolOrNone unicode, StringOrNone collation, string concurrencyMode)
        {
            ValidatePrereqCommand(prereq);

            _theDefault      = theDefault;
            _maxLength       = maxLength;
            _fixedLength     = fixedLength;
            _precision       = precision;
            _scale           = scale;
            _unicode         = unicode;
            _collation       = collation;
            _concurrencyMode = concurrencyMode;

            AddPreReqCommand(prereq);
        }
        /// <summary>
        ///     Sets facets on the property being created by the passed in command.
        /// </summary>
        /// <param name="prereq">Must be non-null command creating the storage property</param>
        /// <param name="theDefault">Optional facet</param>
        /// <param name="maxLength">Optional facet</param>
        /// <param name="fixedLength">Optional facet</param>
        /// <param name="precision">Optional facet</param>
        /// <param name="scale">Optional facet</param>
        /// <param name="unicode">Optional facet</param>
        /// <param name="collation">Optional facet</param>
        /// <param name="concurrencyMode">Optional facet</param>
        internal SetPropertyFacetsCommand(
            CreatePropertyCommand prereq, StringOrNone theDefault,
            StringOrPrimitive<UInt32> maxLength, BoolOrNone fixedLength, StringOrPrimitive<UInt32> precision,
            StringOrPrimitive<UInt32> scale, BoolOrNone unicode, StringOrNone collation, string concurrencyMode)
        {
            ValidatePrereqCommand(prereq);

            _theDefault = theDefault;
            _maxLength = maxLength;
            _fixedLength = fixedLength;
            _precision = precision;
            _scale = scale;
            _unicode = unicode;
            _collation = collation;
            _concurrencyMode = concurrencyMode;

            AddPreReqCommand(prereq);
        }
Пример #8
0
        internal PropertyClipboardFormat(Property property)
            : base(property)
        {
            var complexProperty = property as ComplexConceptualProperty;

            if (complexProperty != null)
            {
                _propertyType      = complexProperty.ComplexType.RefName;
                _isComplexProperty = true;
            }
            else
            {
                _propertyType      = property.TypeName;
                _isComplexProperty = false;
            }
            _isNullable      = (property.Nullable.Value.StringValue == null ? property.Nullable.Value.PrimitiveValue : (bool?)null);
            _isKeyProperty   = property.IsKeyProperty;
            _defaultValue    = property.DefaultValue.Value;
            _concurrencyMode = property.ConcurrencyMode.IsDefaulted ? null : property.ConcurrencyMode.Value;
            _maxLength       = property.MaxLength.IsDefaulted ? null : property.MaxLength.Value;
            _fixedLength     = property.FixedLength.GetAsNullableBool();
            _precision       = property.Precision.Value;
            _scale           = property.Scale.Value;
            _unicode         = property.Unicode.GetAsNullableBool();
            _collation       = property.Collation.Value;

            var conceptualProp = property as ConceptualProperty;

            if (conceptualProp != null)
            {
                _isConceptualProperty  = true;
                _storeGeneratedPattern = conceptualProp.StoreGeneratedPattern.IsDefaulted
                                             ? null
                                             : conceptualProp.StoreGeneratedPattern.Value;
            }
            else
            {
                _isConceptualProperty  = false;
                _storeGeneratedPattern = null;
            }
        }
        internal PropertyClipboardFormat(Property property)
            : base(property)
        {
            var complexProperty = property as ComplexConceptualProperty;
            if (complexProperty != null)
            {
                _propertyType = complexProperty.ComplexType.RefName;
                _isComplexProperty = true;
            }
            else
            {
                _propertyType = property.TypeName;
                _isComplexProperty = false;
            }
            _isNullable = (property.Nullable.Value.StringValue == null ? property.Nullable.Value.PrimitiveValue : (bool?)null);
            _isKeyProperty = property.IsKeyProperty;
            _defaultValue = property.DefaultValue.Value;
            _concurrencyMode = property.ConcurrencyMode.IsDefaulted ? null : property.ConcurrencyMode.Value;
            _maxLength = property.MaxLength.IsDefaulted ? null : property.MaxLength.Value;
            _fixedLength = property.FixedLength.GetAsNullableBool();
            _precision = property.Precision.Value;
            _scale = property.Scale.Value;
            _unicode = property.Unicode.GetAsNullableBool();
            _collation = property.Collation.Value;

            var conceptualProp = property as ConceptualProperty;
            if (conceptualProp != null)
            {
                _isConceptualProperty = true;
                _storeGeneratedPattern = conceptualProp.StoreGeneratedPattern.IsDefaulted
                                             ? null
                                             : conceptualProp.StoreGeneratedPattern.Value;
            }
            else
            {
                _isConceptualProperty = false;
                _storeGeneratedPattern = null;
            }
        }
        /// <summary>
        ///     Creates a new property in the passed in conceptual entity and optionally sets additional
        ///     facets on the property.
        ///     NOTE: If the cpc already has an active transaction, these changes will be in that transaction
        ///     and the caller of this helper method must commit it to see these changes commited.
        /// </summary>
        /// <param name="cpc"></param>
        /// <param name="name">The name of the property</param>
        /// <param name="entityType">Must be a conceptual entity</param>
        /// <param name="type">The type to use for this property (cannot be empty)</param>
        /// <param name="nullable">Flag whether the property is nullable or not</param>
        /// <param name="theDefault">Optional: the default value for this property</param>
        /// <param name="concurrencyMode">Optional: the concurrency mode for this property</param>
        /// <param name="getterAccessModifier">Optional: Get access modifier.</param>
        /// <param name="setterAccessModifier">Optional: Set access modifier.</param>
        /// <returns>The new Property</returns>
        internal static Property CreateConceptualProperty(
            CommandProcessorContext cpc, string name, ConceptualEntityType entityType,
            string type, bool?nullable, StringOrNone theDefault, string concurrencyMode, string getterAccessModifier,
            string setterAccessModifier,
            StringOrPrimitive <UInt32> maxLength, bool?fixedLength, StringOrPrimitive <UInt32> precision, StringOrPrimitive <UInt32> scale,
            bool?unicode, StringOrNone collation, string storeGeneratedPattern, InsertPropertyPosition insertPosition)
        {
            CommandValidation.ValidateConceptualEntityType(entityType);

            var cpcd = new CreatePropertyCommand(name, entityType, type, nullable, insertPosition);
            var scp  = new SetConceptualPropertyFacetsCommand(
                cpcd, theDefault, concurrencyMode, getterAccessModifier, setterAccessModifier,
                maxLength, DefaultableValueBoolOrNone.GetFromNullableBool(fixedLength), precision, scale,
                DefaultableValueBoolOrNone.GetFromNullableBool(unicode), collation);
            var scpac = new SetConceptualPropertyAnnotationsCommand(cpcd, storeGeneratedPattern);

            var cp = new CommandProcessor(cpc, cpcd, scp, scpac);

            cp.Invoke();

            return(cpcd.CreatedProperty);
        }
 internal ChangePropertyTypeScaleCommand(Property property, StringOrPrimitive <UInt32> value)
     : base(property.Scale, value)
 {
     Property = property;
 }
 internal ChangePropertyTypeLengthCommand(Property property, StringOrPrimitive <UInt32> value)
     : base(property.MaxLength, value)
 {
     Property = property;
 }
 internal ChangePropertyTypePrecisionCommand(Property property, StringOrPrimitive <UInt32> value)
     : base(property.Precision, value)
 {
     Property = property;
 }
        /// <summary>
        ///     Creates a new property in the passed in conceptual entity and optionally sets additional
        ///     facets on the property.
        ///     NOTE: If the cpc already has an active transaction, these changes will be in that transaction
        ///     and the caller of this helper method must commit it to see these changes commited.
        /// </summary>
        /// <param name="cpc"></param>
        /// <param name="name">The name of the property</param>
        /// <param name="entityType">Must be a conceptual entity</param>
        /// <param name="type">The type to use for this property (cannot be empty)</param>
        /// <param name="nullable">Flag whether the property is nullable or not</param>
        /// <param name="theDefault">Optional: the default value for this property</param>
        /// <param name="concurrencyMode">Optional: the concurrency mode for this property</param>
        /// <param name="getterAccessModifier">Optional: Get access modifier.</param>
        /// <param name="setterAccessModifier">Optional: Set access modifier.</param>
        /// <returns>The new Property</returns>
        internal static Property CreateConceptualProperty(
            CommandProcessorContext cpc, string name, ConceptualEntityType entityType,
            string type, bool? nullable, StringOrNone theDefault, string concurrencyMode, string getterAccessModifier,
            string setterAccessModifier,
            StringOrPrimitive<UInt32> maxLength, bool? fixedLength, StringOrPrimitive<UInt32> precision, StringOrPrimitive<UInt32> scale,
            bool? unicode, StringOrNone collation, string storeGeneratedPattern, InsertPropertyPosition insertPosition)
        {
            CommandValidation.ValidateConceptualEntityType(entityType);

            var cpcd = new CreatePropertyCommand(name, entityType, type, nullable, insertPosition);
            var scp = new SetConceptualPropertyFacetsCommand(
                cpcd, theDefault, concurrencyMode, getterAccessModifier, setterAccessModifier,
                maxLength, DefaultableValueBoolOrNone.GetFromNullableBool(fixedLength), precision, scale,
                DefaultableValueBoolOrNone.GetFromNullableBool(unicode), collation);
            var scpac = new SetConceptualPropertyAnnotationsCommand(cpcd, storeGeneratedPattern);

            var cp = new CommandProcessor(cpc, cpcd, scp, scpac);
            cp.Invoke();

            return cpcd.CreatedProperty;
        }
        /// <summary>
        ///     Creates a new property in the passed in storage entity and optionally sets additional
        ///     facets on the property.
        ///     NOTE: If the cpc already has an active transaction, these changes will be in that transaction
        ///     and the caller of this helper method must commit it to see these changes commited.
        /// </summary>
        /// <param name="cpc"></param>
        /// <param name="name">The name of the property</param>
        /// <param name="entityType">Must be a storage entity</param>
        /// <param name="type">The type to use for this property (cannot be empty)</param>
        /// <param name="nullable">Flag whether the property is nullable or not</param>
        /// <param name="theDefault">Optional: the default value for this property</param>
        /// <param name="maxLength">Optional facet</param>
        /// <param name="fixedLength">Optional facet</param>
        /// <param name="precision">Optional facet</param>
        /// <param name="scale">Optional facet</param>
        /// <param name="unicode">Optional facet</param>
        /// <param name="collation">Optional facet</param>
        /// <param name="concurrencyMode">Optional: the concurrency mode for this property</param>
        /// <returns>The new Property</returns>
        internal static Property CreateStorageProperty(
            CommandProcessorContext cpc, string name, StorageEntityType entityType,
            string type, bool? nullable, StringOrNone theDefault, StringOrPrimitive<UInt32> maxLength, BoolOrNone fixedLength,
            StringOrPrimitive<UInt32> precision,
            StringOrPrimitive<UInt32> scale, BoolOrNone unicode, StringOrNone collation, string concurrencyMode)
        {
            CommandValidation.ValidateStorageEntityType(entityType);

            var cpcd = new CreatePropertyCommand(name, entityType, type, nullable);
            var ssp = new SetPropertyFacetsCommand(
                cpcd, theDefault, maxLength, fixedLength, precision, scale, unicode, collation, concurrencyMode);

            var cp = new CommandProcessor(cpc, cpcd, ssp);
            cp.Invoke();

            return cpcd.CreatedProperty;
        }
 protected internal override string ConvertValueToString(StringOrPrimitive <UInt32> val)
 {
     return(StringOrPrimitiveConverter <UInt32> .StringConverter(val));
 }
 protected internal override string ConvertValueToString(StringOrPrimitive<UInt32> val)
 {
     return StringOrPrimitiveConverter<UInt32>.StringConverter(val);
 }