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); }
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); } }