public WMIBaseBoard GetWMIBaseBoard()
        {
            ManagementBaseObject result = Execute(new WMIBaseBoardQuery(entity: typeof(WMIBaseBoard)))
                                          .Cast <ManagementBaseObject>().FirstOrDefault();

            return(result == null ? null : WMIMapper <WMIBaseBoard> .Extract(result));
        }
        public WMIComputerSystem GetComputerSystemInformation()
        {
            ManagementBaseObject result = Execute(new WMIComputerSystemQuery(entity: typeof(WMIComputerSystem)))
                                          .Cast <ManagementBaseObject>().FirstOrDefault();

            return(result == null? null : WMIMapper <WMIComputerSystem> .Extract(result));
        }
Ejemplo n.º 3
0
        public WMIProcessor GetWMIProcessor()
        {
            ManagementBaseObject result = Execute(new WMIProcessorQuery(entity: typeof(WMIProcessor)))
                                          .Cast <ManagementBaseObject>().FirstOrDefault();

            return(result == null ? null : WMIMapper <WMIProcessor> .Extract(result));
        }
        public WMIPerfDataProcess GetWMIPerfDataProcessByName(string name)
        {
            ManagementBaseObject managementBaseObject = Execute(new WMIPerfDataProcessQuery
                                                                    ($"Name = {name}", typeof(WMIPerfDataProcess)))
                                                        .Cast <ManagementBaseObject>().FirstOrDefault();

            return(managementBaseObject != null? WMIMapper <WMIPerfDataProcess>
                   .Extract(managementBaseObject) : null);
        }
        public WMIPerfDataProcess GetWMIPerfDataProcessById(int id)
        {
            ManagementBaseObject managementBaseObject = Execute(new WMIPerfDataProcessQuery
                                                                    ($"IDProcess = {id}", typeof(WMIPerfDataProcess)))
                                                        .Cast <ManagementBaseObject>().FirstOrDefault();

            return(managementBaseObject != null? WMIMapper <WMIPerfDataProcess>
                   .Extract(managementBaseObject) : null);
        }
        public WMIProcess GetWMIProcessByName(string name)
        {
            ManagementBaseObject result
                = Execute(new WMIProcessQuery(condition: $"Name = '{name}'",
                                              entity: typeof(WMIProcess))).Cast <ManagementBaseObject>()
                  .FirstOrDefault();

            return(result == null? null : WMIMapper <WMIProcess> .Extract(result));
        }
        public IEnumerable <WMIPerfDataProcess> GetWMIPerfDataProcesses()
        {
            IList <WMIPerfDataProcess> wmiPerfDataProcesses = new List <WMIPerfDataProcess>();
            ManagementObjectCollection managementObjectCollection
                = Execute(new WMIPerfDataProcessQuery(entity: typeof(WMIPerfDataProcess)));

            foreach (ManagementBaseObject managementObject in managementObjectCollection)
            {
                wmiPerfDataProcesses.Add(WMIMapper <WMIPerfDataProcess> .Extract(managementObject));
            }
            return(wmiPerfDataProcesses);
        }
        public IEnumerable <WMIPhysicalMemory> GetWMIPhysicalMemories()
        {
            IList <WMIPhysicalMemory>  physicalMemories = new List <WMIPhysicalMemory>();
            ManagementObjectCollection managementObjectCollection
                = Execute(new WMIPhysicalMemoryQuery(entity: typeof(WMIPhysicalMemory)));

            foreach (ManagementBaseObject managementBaseObject in managementObjectCollection)
            {
                physicalMemories.Add(WMIMapper <WMIPhysicalMemory> .Extract(managementBaseObject));
            }
            return(physicalMemories);
        }
        public IEnumerable <WMIVideoController> GetWMIVideoControllers()
        {
            IList <WMIVideoController> videoControllers = new List <WMIVideoController>();
            ManagementObjectCollection managementObjectCollection
                = Execute(new WMIVideoControllerQuery());

            foreach (ManagementBaseObject ManagementBaseObject in managementObjectCollection)
            {
                videoControllers.Add(WMIMapper <WMIVideoController> .Extract(ManagementBaseObject));
            }
            return(videoControllers);
        }
Ejemplo n.º 10
0
        public IEnumerable <WMIDiskDrive> GetWMIDiskDrives()
        {
            IList <WMIDiskDrive>       diskDrives = new List <WMIDiskDrive>();
            ManagementObjectCollection managementObjectCollection
                = Execute(new WMIDiskDriveQuery(condition: "MediaType = 'Fixed hard disk media'",
                                                entity: typeof(WMIDiskDrive)));

            foreach (ManagementBaseObject managementObject in managementObjectCollection)
            {
                diskDrives.Add(WMIMapper <WMIDiskDrive> .Extract(managementObject));
            }
            return(diskDrives);
        }