A System.ComponentModel.TypeConverter allowing to display objects of type FxDetector.NativeMethods.MODULEENTRY32 in a System.Windows.Forms.PropertyGrid.
상속: System.ComponentModel.ExpandableObjectConverter
예제 #1
0
파일: helpers.cs 프로젝트: odalet/Hawkeye2
 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);
            });
        }