예제 #1
0
파일: VForm.cs 프로젝트: windrobin/kumpro
        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();
        }
예제 #2
0
파일: VForm.cs 프로젝트: windrobin/kumpro
 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;
     }
 }
예제 #3
0
파일: VForm.cs 프로젝트: windrobin/kumpro
            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);
                }
            }
예제 #4
0
        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);
        }