Example #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(
                          string.Format("Invalid property type to make a flat copy. Expected {0}, current {1}",
                                        typeof(ComplexProperty), source.GetType()));
            }

            base.MakeFlatCopyFrom(source);

            Properties = complexProperty.Properties;
        }
Example #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(
                          string.Format("Invalid property type to make a flat copy. Expected {0}, current {1}",
                                        typeof(CollectionProperty), source.GetType()));
            }

            base.MakeFlatCopyFrom(source);

            ElementType = collectionSource.ElementType;
            Items       = collectionSource.Items;
        }
Example #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(
                          string.Format("Invalid property type to make a flat copy. Expected {0}, current {1}",
                                        typeof(SingleDimensionalArrayProperty), source.GetType()));
            }

            base.MakeFlatCopyFrom(source);

            ElementType    = arrayProp.ElementType;
            DimensionInfos = arrayProp.DimensionInfos;
            Items          = arrayProp.Items;
        }
Example #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(
                          string.Format("Invalid property type to make a flat copy. Expected {0}, current {1}",
                                        typeof(DictionaryProperty), source.GetType()));
            }

            base.MakeFlatCopyFrom(source);

            KeyType   = dictionarySource.KeyType;
            ValueType = dictionarySource.ValueType;
            Items     = dictionarySource.Items;
        }
Example #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;
 }