コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
ファイル: ArrayObject.cs プロジェクト: rogeralsing/Puzzle.NET
        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));
        }
コード例 #6
0
        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));
        }