A System.ComponentModel.TypeConverter allowing to display objects of type FxDetector.NativeMethods.MODULEENTRY32 in a System.Windows.Forms.PropertyGrid.
Inheritance: System.ComponentModel.ExpandableObjectConverter
示例#1
0
 public static void DumpTo(this NativeMethods.MODULEENTRY32 module, StringBuilder builder, int tabCount)
 {
     var converter = new ModuleEntryConverter();
     converter.GetProperties(module)
         .Cast<PropertyDescriptor>()
         .OrderBy(pd => pd.Name)
         .Select(pd => new
         {
             Name = pd.Name,
             Value = pd.GetValue(module).ToString()
         })
         .Aggregate((acc, pair) =>
         {
             builder.AppendFormattedLine(tabCount, "{0} = {1}",
                 pair.Name, pair.Value);
             return pair;
         });
 }
示例#2
0
        public static void DumpTo(this NativeMethods.MODULEENTRY32 module, StringBuilder builder, int tabCount)
        {
            var converter = new ModuleEntryConverter();

            converter.GetProperties(module)
            .Cast <PropertyDescriptor>()
            .OrderBy(pd => pd.Name)
            .Select(pd => new
            {
                Name  = pd.Name,
                Value = pd.GetValue(module).ToString()
            })
            .Aggregate((acc, pair) =>
            {
                builder.AppendFormattedLine(tabCount, "{0} = {1}",
                                            pair.Name, pair.Value);
                return(pair);
            });
        }