I know how to gain access to management-objects. Lets say this one:
var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter");
foreach (var nic in searcher.Get())
{
Console.WriteLine(nic["caption"]);
}
Now this nic[]-synthax is very bad to use. If I take a look at visual studios server explorer I see, that it fills up a property grid for each object I select. Smells like they are creating bindable classes there. Are there any libs or approaches to do the same? I would like to get a syntax like
var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter");
foreach (var nic in searcher.Get())
{
Console.WriteLine((nic as Win32NetworkAdapter).Caption);
}
I just don't want to waste my time implementing something new which was invented already!