Exemple #1
0
 public override PropertyDescriptorCollection GetProperties()
 {
     var descriptors = new PropertyDescriptor[Object.Count];
     var i = 0;
     foreach (var entry in Object)
     {
         descriptors[i++] =
             new HashPropertyDescriptor(Convert.ToString(entry.Key, CultureInfo.InvariantCulture), entry.Value);
     }
     //            PropertyDescriptor[] descriptors = Object.Select(
     //                entry => new HashPropertyDescriptor(Convert.ToString(entry.Key, CultureInfo.InvariantCulture), entry.Value)).ToArray();
     return new PropertyDescriptorCollection(descriptors);
 }
Exemple #2
0
        public override PropertyDescriptorCollection GetProperties()
        {
            var descriptors = new PropertyDescriptor[Object.Count];
            var i           = 0;

            foreach (var entry in Object)
            {
                descriptors[i++] =
                    new HashPropertyDescriptor(Convert.ToString(entry.Key, CultureInfo.InvariantCulture), entry.Value);
            }
//            PropertyDescriptor[] descriptors = Object.Select(
//                entry => new HashPropertyDescriptor(Convert.ToString(entry.Key, CultureInfo.InvariantCulture), entry.Value)).ToArray();
            return(new PropertyDescriptorCollection(descriptors));
        }