Ejemplo n.º 1
0
        public object Get(string Property)
        {
            Exception = null;

            CacheItemProperty pi = _ct.Property(Property);

            object res = null;

            if (_ct.Exception == null)
            {
                res = pi.Get(Handle, null);
                if (pi.Exception == null)
                {
                    if (res.GetType().IsArray)
                    {
                        object[,] p = null;
                        ParameterCleaner.Build2DOutput(string.Empty, res, out p);
                        res = p;
                    }
                }
                else
                {
                    Exception = pi.Exception;
                }
            }
            else
            {
                Exception = _ct.Exception;
            }

            return(res);
        }
Ejemplo n.º 2
0
        public object Get()
        {
            Exception = null;

            List <object[, ]> r = new List <object[, ]>();

            int x = 0, y = 0;

            foreach (CacheItemProperty k in _ct.Property())
            {
                object t = k.Get(Handle, null);
                if (k.Exception != null)
                {
                    Exception = k.Exception;
                    break;
                }
                else
                {
                    object[,] p = null;
                    ParameterCleaner.Build2DOutput(k.ExcelName, t, out p);
                    r.Add(p);

                    x += p.GetLength(0);
                    y  = Math.Max(y, p.GetLength(1));
                }
            }

            object[,] res = new object[x, y];
            for (int i = 0, z = 0; i < r.Count; i++)
            {
                for (int j = 0; j < r[i].GetLength(0); j++)
                {
                    for (int k = 0; k < r[i].GetLength(1); k++)
                    {
                        res[z + j, k] = r[i][j, k];
                    }

                    for (int k = r[i].GetLength(1); k < y; k++)
                    {
                        res[z + j, k] = string.Empty;
                    }
                }

                z += r[i].GetLength(0);
            }

            return(res);
        }