示例#1
0
        private void SetInputData(RegResourceItem.FullResourceDescriptor frd)
        {
            IntTypeAnsLabel.Text = RegResourceItem.GetInterfaceString(frd.InterfaceType);
            BusNumAnsLabel.Text  = frd.BusNumber.ToString();

            foreach (RegResourceItem.PartialResourceDescriptor prd in frd.PartialResourceDescriptors)
            {
                string[]     listOfItems = null;
                ListViewItem lvItem      = null;
                switch (prd.Type)
                {
                case RegResourceItem.ResourceType.Dma:
                    break;

                case RegResourceItem.ResourceType.Interrupt:
                    listOfItems = new string[4];
                    RegResourceItem.HardwareResource.Interrupt hri = (RegResourceItem.HardwareResource.Interrupt)prd.Resource;
                    //Vector
                    listOfItems[0] = hri.Vector.ToString();
                    //Level
                    listOfItems[1] = hri.Level.ToString();
                    //Affinity
                    listOfItems[2] = "0x" + RegistryUtils.DecimalToBase(hri.Affinity, 16);
                    //Type
                    listOfItems[3] = "Level Sensitive";         // Need to check this can be hardcorded or not

                    lvItem = new ListViewItem(listOfItems);
                    LWlvInterrupt.Items.Add(lvItem);
                    break;

                case RegResourceItem.ResourceType.Memory:
                    listOfItems = new string[3];
                    RegResourceItem.HardwareResource.Memory hrm = (RegResourceItem.HardwareResource.Memory)prd.Resource;
                    //Physical Address
                    listOfItems[0] = "0x" + RegistryUtils.DecimalToBase(hrm.Start, 16);
                    //Length
                    listOfItems[1] = "0x" + RegistryUtils.DecimalToBase(hrm.Length, 16);
                    //Access
                    listOfItems[2] = "Unknown";         // How to get this ?

                    lvItem = new ListViewItem(listOfItems);
                    LWlvMemory.Items.Add(lvItem);
                    break;

                case RegResourceItem.ResourceType.Port:
                    listOfItems = new string[3];
                    RegResourceItem.HardwareResource.Port hrp = (RegResourceItem.HardwareResource.Port)prd.Resource;
                    //Physical Address
                    listOfItems[0] = "0x" + RegistryUtils.DecimalToBase(hrp.Start, 16);
                    //Length
                    listOfItems[1] = "0x" + RegistryUtils.DecimalToBase(hrp.Length, 16);
                    //Type
                    listOfItems[2] = "Port";         // How to get this ?

                    lvItem = new ListViewItem(listOfItems);
                    LWlvPort.Items.Add(lvItem);
                    break;

                case RegResourceItem.ResourceType.DeviceSpecific:
                    break;
                }
            }
        }