Beispiel #1
0
        /// <summary>
        ///     Makes flat copy (only references) of vital properties
        /// </summary>
        /// <param name="source"></param>
        public override void MakeFlatCopyFrom(ReferenceTargetProperty source)
        {
            var complexProperty = source as ComplexProperty;

            if (complexProperty == null)
            {
                throw new InvalidCastException(
                          $"Invalid property type to make a flat copy. Expected {typeof(ComplexProperty)}, current {source.GetType()}");
            }

            base.MakeFlatCopyFrom(source);

            Properties = complexProperty.Properties;
        }
        /// <summary>
        ///     Makes flat copy (only references) of vital properties
        /// </summary>
        /// <param name="source"></param>
        public override void MakeFlatCopyFrom(ReferenceTargetProperty source)
        {
            var collectionSource = source as CollectionProperty;

            if (collectionSource == null)
            {
                throw new InvalidCastException(
                          $"Invalid property type to make a flat copy. Expected {typeof(CollectionProperty)}, current {source.GetType()}");
            }

            base.MakeFlatCopyFrom(source);

            ElementType = collectionSource.ElementType;
            Items       = collectionSource.Items;
        }
Beispiel #3
0
        /// <summary>
        ///     Makes flat copy (only references) of vital properties
        /// </summary>
        /// <param name="source"></param>
        public override void MakeFlatCopyFrom(ReferenceTargetProperty source)
        {
            var arrayProp = source as MultiDimensionalArrayProperty;

            if (arrayProp == null)
            {
                throw new InvalidCastException(
                          $"Invalid property type to make a flat copy. Expected {typeof(SingleDimensionalArrayProperty)}, current {source.GetType()}");
            }

            base.MakeFlatCopyFrom(source);

            ElementType    = arrayProp.ElementType;
            DimensionInfos = arrayProp.DimensionInfos;
            Items          = arrayProp.Items;
        }
Beispiel #4
0
        /// <summary>
        ///     Makes flat copy (only references) of vital properties
        /// </summary>
        /// <param name="source"></param>
        public override void MakeFlatCopyFrom(ReferenceTargetProperty source)
        {
            var dictionarySource = source as DictionaryProperty;

            if (dictionarySource == null)
            {
                throw new InvalidCastException(
                          $"Invalid property type to make a flat copy. Expected {typeof(DictionaryProperty)}, current {source.GetType()}");
            }

            base.MakeFlatCopyFrom(source);

            KeyType   = dictionarySource.KeyType;
            ValueType = dictionarySource.ValueType;
            Items     = dictionarySource.Items;
        }
Beispiel #5
0
 /// <summary>
 ///     Makes flat copy (only references) of vital properties
 /// </summary>
 /// <param name="source"></param>
 public virtual void MakeFlatCopyFrom(ReferenceTargetProperty source)
 {
     Reference = source.Reference;
 }