コード例 #1
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);
            this.SuspendLayout();

            /*
             * PCI-Devices
             */

            DeviceClean dc = cleaner.DeviceCleaner;

            dc.Investigate();

            TreeNode pciDevicesNode = treeView1.Nodes.Add("");

            if (dc.Result == InvestigationResult.Unclean)
            {
                pciDevicesNode.ForeColor = Color.Red;
            }
            else if (dc.Result == InvestigationResult.Clean)
            {
                pciDevicesNode.ForeColor = Color.Green;
            }
            else if (dc.Result == InvestigationResult.Unknown)
            {
                pciDevicesNode.ForeColor = Color.Blue;
            }
            pciDevicesNode.Text = dc.ResultText;

            foreach (var device in dc.Devices)
            {
                TreeNode deviceNode = pciDevicesNode.Nodes.Add(device.ID);
                deviceNode.ForeColor = device.Clean ? Color.Green : Color.Red;

                foreach (var d in device.Parameters)
                {
                    deviceNode.Nodes.Add(d.Key + ": " + d.Value);
                }
            }

            pciDevicesNode.Expand();


            /*
             * Leftofer XEN Driver Files in C:\windows\system32
             */

            FileClean fc = cleaner.FileCleaner;

            if (fc.Investigate())
            {
                TreeNode xenDriverFilesNode = treeView1.Nodes.Add("Leftover XenDrivers in " + fc.Path);
                xenDriverFilesNode.ForeColor = Color.Red;

                foreach (var xenDriverFile in fc.Files)
                {
                    xenDriverFilesNode.Nodes.Add(xenDriverFile.FullName);
                }

                xenDriverFilesNode.ExpandAll();
            }
            else
            {
                TreeNode xenDriverFilesNode = treeView1.Nodes.Add("No Leftover XenDrivers in " + fc.Path);
                xenDriverFilesNode.ForeColor = Color.Green;
            }


            this.ResumeLayout();
        }
コード例 #2
0
ファイル: Cleaner.cs プロジェクト: xcp-ng/win-installer-ng
 public Cleaner()
 {
     DeviceCleaner = new DeviceClean();
     FileCleaner   = new FileClean();
 }