public override IList Invoke(IListReadOnly src) { var result = (IList)_destListConstructor.Invoke(null); SynchRecordsCount(src, result); return(result); }
private static void FillSimpleData(IListReadOnly src, IList dest) { var i = 0; foreach (var srcitem in src) { dest[i++] = srcitem; } }
public override IList Invoke(IListReadOnly src) { var result = (IList)Array.CreateInstance(_destElementType, src.Count); for (int i = 0; i < result.Count; i++) { result[i] = _destElementCtor.Invoke(null); } return(result); }
public override void SynchRecordsCount(IListReadOnly src, IList dest) { while (src.Count != dest.Count) { if (dest.Count < src.Count) { dest.Add(_destElementCtor.Invoke(null)); } else { dest.RemoveAt(dest.Count - 1); } } }
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++; } }
public abstract IList Invoke(IListReadOnly src);
public SourceArrayListReadOnly(IListReadOnly list) { _list = list; }
public override void SynchRecordsCount(IListReadOnly src, IList dest) { while (src.Count != dest.Count) { if (dest.Count < src.Count) dest.Add(_destElementCtor.Invoke(null)); else dest.RemoveAt(dest.Count-1); } }
public override IList Invoke(IListReadOnly src) { var result = (IList)_destListConstructor.Invoke(null); SynchRecordsCount(src, result); return result; }
public override void SynchRecordsCount(IListReadOnly src, IList dest) { throw new Exception("Array can not be synched"); }
public abstract void SynchRecordsCount(IListReadOnly src, IList dest);
public SourceArrayListReadOnly(IListReadOnly list) { _list = list; }
public override void SynchRecordsCount(IListReadOnly src, IList dest) { throw new Exception("Array can not be synched"); }
private static void FillSimpleData(IListReadOnly src, IList dest) { var i = 0; foreach (var srcitem in src) { dest[i++] = srcitem; } }
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++; } }
public abstract void SynchRecordsCount(IListReadOnly src, IList dest);
public override IList Invoke(IListReadOnly src) { var result = (IList)Array.CreateInstance(_destElementType, src.Count); for (int i = 0; i < result.Count; i++) result[i] = _destElementCtor.Invoke(null); return result; }
public abstract IList Invoke(IListReadOnly src);