public void Build(SerializerEngine engine, Array rawArray) { Items = new ObjectBase[rawArray.Length]; for (int i = 0; i < rawArray.Length; i++) { object rawValue = rawArray.GetValue(i); Items[i] = engine.GetObject(rawValue); } }
public void Build(SerializerEngine engine, IList rawList) { Items = new ObjectBase[rawList.Count]; for (int i = 0; i < rawList.Count; i++) { object rawValue = rawList[i]; Items[i] = engine.GetObject(rawValue); } }
public void Build(SerializerEngine engine, Array item) { int rank; int[] dimensions; int[] lowerBounds; int[] upperBounds; SetupLoopData(item, out rank, out dimensions, out lowerBounds, out upperBounds); int[] lengths = new int[rank]; for (int i = 0; i < rank; i++) { lengths[i] = upperBounds[i] - lowerBounds[i] + 1; } Items = Array.CreateInstance(typeof(ObjectBase), lengths, lowerBounds); Array arr = Items; do { object rawValue = item.GetValue(dimensions); ObjectBase obj = engine.GetObject(rawValue); arr.SetValue(obj, dimensions); } while (IncreaseDimension(dimensions, lowerBounds, upperBounds, rank - 1)); }
public void Build(SerializerEngine engine, Array item) { int rank; int[] dimensions; int[] lowerBounds; int[] upperBounds; SetupLoopData(item, out rank, out dimensions, out lowerBounds, out upperBounds); int[] lengths = new int[rank]; for (int i = 0; i < rank; i++) lengths[i] = upperBounds[i] - lowerBounds[i] + 1; Items = Array.CreateInstance(typeof (ObjectBase), lengths, lowerBounds); Array arr = Items; do { object rawValue = item.GetValue(dimensions); ObjectBase obj = engine.GetObject(rawValue); arr.SetValue(obj, dimensions); } while (IncreaseDimension(dimensions, lowerBounds, upperBounds, rank - 1)); }