-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVideoControllerConfig.cs
43 lines (38 loc) · 1.61 KB
/
VideoControllerConfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Collections.Generic;
using System.Management;
namespace powerLabel
{
public class VideoControllerConfig
{
public int id { get; set; }
public VideoController videoController { get; set; }
public ComputerSystem computerSystem { get; set; }
public static List<VideoControllerConfig> GetVideoControllers(ComputerSystem system)
{
List<VideoControllerConfig> list = new List<VideoControllerConfig>();
ManagementObjectCollection returned = PSInterface.RunObjectQuery("SELECT * FROM Win32_VideoController");
foreach (ManagementObject item in returned)
{
VideoControllerConfig videoController = new VideoControllerConfig();
videoController.videoController = new VideoController();
videoController.videoController.manufacturer = (string)item["AdapterCompatibility"];
videoController.videoController.name = (string)item["Caption"];
videoController.videoController.vram = (uint)item["AdapterRam"];
videoController.computerSystem = system;
list.Add(videoController);
}
return list;
}
public override bool Equals(object obj)
{
if (obj == null || GetType() != obj.GetType()) return false;
VideoControllerConfig videoControllerConfig = (VideoControllerConfig)obj;
if (this.videoController.Equals(videoControllerConfig.videoController)
)
{
return true;
}
return false;
}
}
}