Пример #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);

            this.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);

            this.ElementType    = arrayProp.ElementType;
            this.DimensionInfos = arrayProp.DimensionInfos;
            this.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);

            this.KeyType   = dictionarySource.KeyType;
            this.ValueType = dictionarySource.ValueType;
            this.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)
 {
     this.Reference = source.Reference;
 }