Example #1
0
        private void cbPath_SelectedIndexChanged(object sender, EventArgs e)
        {
            lvP.Items.Clear();
            DevPath path = cbPath.SelectedItem as DevPath;

            if (path == null)
            {
                return;
            }
            int y = 0;

            foreach (var pif in EUt.All(path.Path.EnumBindingInterfaces()))
            {
                if (y == 0)
                {
                    var c0  = pif.GetUpperComponent();
                    var lvi = lvP.Items.Add(c0.GetDisplayName());
                    lvi.ImageKey = "C";
                }

                {
                    var lvi = lvP.Items.Add(pif.GetName());
                    lvi.ImageKey = "ES";
                }

                {
                    var c1  = pif.GetLowerComponent();
                    var lvi = lvP.Items.Add(c1.GetDisplayName());
                    lvi.ImageKey = "C";
                }
                ++y;
            }

            lvP.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
        }
Example #2
0
        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();
        }
Example #3
0
        private void gv_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            var    row  = gv.Rows[e.RowIndex];
            String id   = (String)row.Cells[cId.Index].Value;
            var    bind = (INetCfgComponentBindings)pnetcfg.FindComponent(id);

            cbPath.Items.Clear();
            {
                foreach (var path in EUt.All(bind.EnumBindingPaths(EBP_ABOVE)))
                {
                    cbPath.Items.Add(new DevPath {
                        Path = path
                    });
                }
                cbPath.Items.Add("--- Me ---");
                foreach (var path in EUt.All(bind.EnumBindingPaths(EBP_BELOW)))
                {
                    cbPath.Items.Add(new DevPath {
                        Path = path
                    });
                }
            }
            lvP.Items.Clear();
        }