コード例 #1
0
        public IEnumerable <TVal> FireAndReturn()
        {
            var needLeoMember = _context.NeedLeoMember;
            var needLeoIndex  = _context.NeedLeoNumber;
            var index         = 0;

            foreach (var name in _visitor.GetMemberNames())
            {
                if (needLeoMember && needLeoIndex)
                {
                    yield return(_context.Do(name, _visitor[name], _memberHandler.Value[name], index++));
                }
                else if (needLeoMember)
                {
                    yield return(_context.Do(name, _visitor[name], _memberHandler.Value[name]));
                }
                else
                {
                    yield return(_context.Do(name, _visitor[name], null));
                }
            }
        }
コード例 #2
0
ファイル: LeoLooper.cs プロジェクト: wwwK/Leo
        public void Fire()
        {
            var needLeoMember = _context.NeedLeoMember;
            var needLeoIndex  = _context.NeedLeoNumber;
            var index         = 0;

            foreach (var name in _visitor.GetMemberNames())
            {
                if (needLeoMember && needLeoIndex)
                {
                    _context.Do(name, _visitor[name], _memberHandler.Value[name], index++);
                }
                else if (needLeoMember)
                {
                    _context.Do(name, _visitor[name], _memberHandler.Value[name]);
                }
                else
                {
                    _context.Do(name, _visitor[name], null);
                }
            }
        }