private IEnumerator <ILiquidizable> GetEnumeratorInternal()
 {
     return(_enumerable
            .Cast <object>()
            .Select(x => LiquidUtil.CreateSafeObject(x))
            .OfType <ILiquidizable>()
            .GetEnumerator());
 }
Example #2
0
        protected object GetOrCreateSafeObject(string name)
        {
            if (!_safeObjects.TryGetValue(name, out var safeObject))
            {
                safeObject = LiquidUtil.CreateSafeObject(InvokeMember(name));
                if (safeObject is ISafeObject)
                {
                    _safeObjects[name] = safeObject;
                }
            }

            return(safeObject);
        }