Пример #1
0
        protected virtual NameValueList OnGetItems(string name)
        {
            NameValueMapping nv = NameValueMappingCollection.Instance[name];

            if (nv == null)
            {
                return(null);
            }

            var           dv  = NameValueMappingCollection.Instance.GetDataSource(name);
            NameValueList ret = new NameValueList {
                Name = name, NameValues = new Dictionary <string, string>()
            };

            foreach (System.Data.DataRowView dvr in dv)
            {
                ret.NameValues[dvr[nv.ValueMember].ToString()] = dvr[nv.DisplayMember].ToString();
            }
            return(ret);
        }
        protected virtual NameValueList OnGetItems(string name)
        {
            NameValueMapping nv = NameValueMappingCollection.Instance[name];
            if (nv == null)
                return null;

            var dv = NameValueMappingCollection.Instance.GetDataSource(name);
            NameValueList ret = new NameValueList { Name = name, NameValues = new Dictionary<string, string>() };
            foreach (System.Data.DataRowView dvr in dv)
            {
                ret.NameValues[dvr[nv.ValueMember].ToString()] = dvr[nv.DisplayMember].ToString();
            }
            return ret;
        }