예제 #1
0
        public static DataChange <T> GetData(T[] array, IIndexOverlay overlay)
        {
            if (!overlay.ContainsIndexes)
            {
                return(new DataChange <T>());
            }
            if (overlay.LastIndex > array.Length)
            {
                throw new IndexOutOfRangeException();
            }

            DataChange <T> result = new DataChange <T>();

            foreach (var item in (overlay as IEnumerable <KeyValuePair <int, int> >))
            {
                T[] temp = new T[item.Value];
                Array.Copy(array, item.Key, temp, 0, temp.Length);
                result.AddChangedData(item.Key, array);
            }
            return(result);
        }
예제 #2
0
 public void Dispose()
 {
     enume.Dispose();
     parent = null;
     index  = 0;
 }
예제 #3
0
 public ChangeEnumerator(DataChange <T> parent)
 {
     this.parent = parent;
     this.enume  = parent.dataToChange.GetEnumerator();
     this.Reset();
 }