예제 #1
0
        // Makes an array, but automatically resizes the result
        public static object MakeArrayAndResize(int rows, int columns, string unused, string unusedtoo)
        {
            object[,] result = MakeArray(rows, columns);
            return(ArrayResizer.Resize(result));

            // Can also call Resize via Excel - so if the Resize add-in is not part of this code, it should still work
            // (though calling direct is better for large arrays - it prevents extra marshaling).
            // return XlCall.Excel(XlCall.xlUDF, "Resize", result);
        }
예제 #2
0
        public static object MakeMixedArrayAndResize(int rows, int columns)
        {
            object[,] result = new object[rows, columns];
            for (int j = 0; j < columns; j++)
            {
                result[0, j] = "Col " + j;
            }
            for (int i = 1; i < rows; i++)
            {
                for (int j = 0; j < columns; j++)
                {
                    result[i, j] = i + (j * 0.1);
                }
            }

            return(ArrayResizer.Resize(result));
        }
예제 #3
0
 public static double[,] MakeArrayAndResizeDoubles(int rows, int columns)
 {
     double[,] result = MakeArrayDoubles(rows, columns);
     return(ArrayResizer.ResizeDoubles(result));
 }
예제 #4
0
 public static object GetKingsResize()
 {
     return(ExcelAsyncUtil.Run("GetKingsResize", new object[] { }, () => ArrayResizer.Resize(JFetch.JFetchSync("http://mysafeinfo.com/api/data?list=englishmonarchs&format=json", client))));
 }