示例#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;
        }
示例#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;
        }
示例#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;
        }
示例#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;
        }
示例#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;
 }