コード例 #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;
        }
コード例 #2
0
        /// <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;
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #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;
 }