Source/NFX/Serialization/SerializationUtils.cs
/// <summary>
/// Performs an action on each element of a possibly mutidimensional array
/// </summary>
Performs an action on each element of a possibly mutidimensional array
Performs an action on each element of a possibly mutidimensional array
public static void WalkArrayWrite(Array arr, Action<object> each)
        {
            var rank = arr.Rank;
            if (rank==1)
            {
                var i = arr.GetLowerBound(0);
                var top = arr.GetUpperBound(0);
                for(; i<=top; i++)
                  each(arr.GetValue(i));
                return;
            }
            var idxs = new int[rank];
            doDimensionGetValue(arr, idxs, 0, each);
        }
public static void WalkArrayWrite ( Array arr , Action < object > each ) { var rank = arr . Rank ; if ( rank == 1 ) { var i = arr . GetLowerBound ( 0 ) ; var top = arr . GetUpperBound ( 0 ) ; for ( ; i <= top ; i ++ ) each ( arr . GetValue ( i ) ) ; return ; } var idxs = new int [ rank ] ; doDimensionGetValue ( arr , idxs , 0 , each ) ; }
Performs an action on each element of a possibly mutidimensional array
Performs an action on each element of a possibly mutidimensional array
arr
Array
each
Action<object>