public override bool Equals(object obj) { ComboObject o = obj as ComboObject; if (o != null) { return (string.Equals(o.DisplayText, DisplayText, StringComparison.CurrentCultureIgnoreCase) && string.Equals(o.ValueText, valueText, StringComparison.CurrentCultureIgnoreCase)); } return(base.Equals(obj)); }
private object GetWmiObject() { ComboObject item = cbxQuery.SelectedItem as ComboObject; if (item == null) { return(null); } switch (item.DisplayText) { case "WMI_COMPUTER_INFORMATION": return (WMIHelper.FillComputerInformation(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_PROCESSOR_INFORMATION": return(WMIHelper.FillProcessorInformation(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); //case "WMI_PROCESSOR_INFORMATION": // return WMIHelper.FillProcessorInformation(txtMachine.Text.Trim(), txtUser.Text.Trim(), // txtPass.Text.Trim(), "Win32_Processor"); case "WMI_BIOS_INFORMATION": return(WMIHelper.FillBiosInformation(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_OS_INFORMATION": return(WMIHelper.FillOSInformation(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_HOTFIX_INFORMATION": return(WMIHelper.FillHotFixes(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_NETWORK_ADAPTER_INFORMATION": return(WMIHelper.FillNetworkAdapter(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_PRINTER_INFORMATION": return(WMIHelper.FillPrinters(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_DISK_DRIVE_INFORMATION": return(WMIHelper.FillDisks(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_LOGICAL_DISK_INFORMATION": return(WMIHelper.FillLogicalDisks(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_VIDEO_CONTROLLER_INFORMATION": return(WMIHelper.FillVideoController(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); case "WMI_SOUND_CARD_INFORMATION": return(WMIHelper.FillSoundCard(txtMachine.Text.Trim(), txtUser.Text.Trim(), txtPass.Text.Trim(), item.ValueText)); } return(null); }