Exemple #1
0
        private void FillReferenceData(IListReadOnly src, IList dest)
        {
            var i = 0;

            foreach (var srcitem in src)
            {
                if (dest[i] == null)
                {
                    var newElement = _elementTypeMap.CreateDestInstance(srcitem);
                    dest[i] = newElement;
                }
                else
                {
                    _elementTypeMap.SynchInstances(srcitem, dest[i]);
                }

                i++;
            }
        }
Exemple #2
0
        public override void FillData(object srcInstance, object destInstance)
        {
            var srcValue = _srcPropertyInfo.GetValue(srcInstance, null);

            if (srcValue == null)
            {
                _destPropertyInfo.SetValue(destInstance, null, null);
                return;
            }

            var destValue = _destPropertyInfo.GetValue(destInstance, null);

            if (destValue == null)
            {
                destValue = _typeMap.CreateDestInstance(srcValue);
                _destPropertyInfo.SetValue(destInstance, destValue, null);
            }
            else
            {
                _typeMap.SynchInstances(srcValue, destValue);
            }
        }