Пример #1
0
        private ArrayInfo getArrayInfo(Type arrayType)
        {
            // Caching is innacceptable, as an array of type string can have different bounds
            var info = new ArrayInfo();

            // Fill the dimension infos
            for (int dimension = 0; dimension < this.getRank(arrayType); dimension++)
            {
                var dimensionInfo = new DimensionInfo();
                dimensionInfo.Length     = this.getLength(dimension, arrayType);
                dimensionInfo.LowerBound = this.getLowerBound(dimension, arrayType);
                info.DimensionInfos.Add(dimensionInfo);
            }

            return(info);
        }
Пример #2
0
 ///<summary>
 ///</summary>
 ///<param name = "array"></param>
 public ArrayAnalyzer(object array)
 {
     _array = array;
     var type = array.GetType();
     _arrayInfo = getArrayInfo(type);
 }
Пример #3
0
        private ArrayInfo getArrayInfo(Type arrayType)
        {
            // Caching is innacceptable, as an array of type string can have different bounds

            var info = new ArrayInfo();

            // Fill the dimension infos
            for (int dimension = 0; dimension < getRank(arrayType); dimension++)
            {
                var dimensionInfo = new DimensionInfo();
                dimensionInfo.Length = getLength(dimension, arrayType);
                dimensionInfo.LowerBound = getLowerBound(dimension, arrayType);
                info.DimensionInfos.Add(dimensionInfo);
            }


            return info;
        }
Пример #4
0
        private ArrayInfo getArrayInfo()
        {
            var info = new ArrayInfo();

            // Fill the dimension infos
            for (int dimension = 0; dimension < getRank(); dimension++)
            {
                var dimensionInfo = new DimensionInfo();
                dimensionInfo.Length = getLength(dimension);
                dimensionInfo.LowerBound = getLowerBound(dimension);
                info.DimensionInfos.Add(dimensionInfo);
            }

            return info;
        }