private void EnumComponents(Guid guid) { // http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/b24acc81-7fb6-43e5-9715-0a74f40163dd IEnumNetCfgComponent penumComponent = pnetcfg.EnumComponents(guid); ds.Component.Rows.Clear(); foreach (var co in EUt.All(penumComponent)) { String PnpDevNodeId = null; try { PnpDevNodeId = co.GetPnpDevNodeId(); } catch (Exception) { } ds.Component.AddComponentRow( co.GetDisplayName(), co.GetHelpText(), co.GetId(), co.GetCharacteristics(), co.GetInstanceGuid(), PnpDevNodeId, co.GetClassGuid(), co.GetBindName() ); } gv.AutoResizeColumns(); }
internal static IEnumerable<INetCfgComponent> All(IEnumNetCfgComponent penum) { int hr; INetCfgComponent one; uint celtFetched; while (0 == (hr = penum.Next(1, out one, out celtFetched)) && celtFetched == 1) { yield return one; } }
internal static IEnumerable <INetCfgComponent> All(IEnumNetCfgComponent penum) { int hr; INetCfgComponent one; uint celtFetched; while (0 == (hr = penum.Next(1, out one, out celtFetched)) && celtFetched == 1) { yield return(one); } }
public static INetCfgComponent GetNextComponent(this IEnumNetCfgComponent instance) { object rawComponent; int fetched; if (0 != instance.Next(1, out rawComponent, out fetched)) { return(null); } if (fetched < 1) { return(null); } return(rawComponent as INetCfgComponent); }