Object 转为List<T>

    private void AddFields(object obj)
        {
            IEnumerable list = obj as IEnumerable;
            foreach (var item in list)
            {
                ReportColumn r = new ReportColumn();
                r.BindingField = item as QueryFieldBase;
                SelectedColumnCollection.Add(r);
            }
        }

所有的集合类的都会实现IEnumerable接口

 

http://blog.csdn.net/swarb/article/details/9000405

posted @ 2015-06-25 10:39  改变你我  阅读(9561)  评论(0编辑  收藏  举报