ForEach() public method

public ForEach ( Action action ) : void
action Action
return void
示例#1
0
        public void Start(Plugin p)
        {
            // p.ForEach(r => { if (r is Record) ++totalRecordCount; });
            // p.While(r => { if (r is Record) { UpdateProgress(); return Process((Record)r); } });
            var recordList = new List<Record>();
            p.ForEach(
                r => {
                    if (r is Record)
                    {
                        recordList.Add((Record)r);
                    }
                });
            this.totalRecordCount = recordList.Count;

            foreach (var kvp in recordList.ToLookup((a) => a.Name))
            {
                if (!this.Process(kvp.Key, kvp.ToArray()))
                {
                    return;
                }
            }
        }