예제 #1
0
파일: OPs.cs 프로젝트: WVitek/DotGlue
        public static object ConstValueOf(object funcOrValue)
        {
            while (true)
            {
                LazySync syncF = funcOrValue as LazySync;
                if (syncF != null)
                {
                    funcOrValue = syncF();
                }
                else
                {
                    break;
                }
            }
            IList list = funcOrValue as IList;

            if (list != null && list.Count > 0)
            {
                if (list is ListOfSync)
                {
                    var res = new object[list.Count];
                    for (int i = 0; i < list.Count; i++)
                    {
                        res[i] = ConstValueOf(list[i]);
                    }
                    return(res);
                }
            }
            return(funcOrValue);
        }
예제 #2
0
파일: OPs.cs 프로젝트: WVitek/DotGlue
        public static object VectorValueOf(object funcOrValue)
        {
            while (true)
            {
                LazySync syncF = funcOrValue as LazySync;
                if (syncF != null)
                {
                    funcOrValue = syncF();
                }
                else
                {
                    break;
                }
            }
            IList list = funcOrValue as IList;

            if (list == null)
            {
                return(new OneValueList(funcOrValue));
            }
            else
            {
                return(funcOrValue);
            }
        }