private void CheckRegValveSteamSmodPath() { try { // Example of using this awesome library var steamData = SteamPathsUtil.GetSteamData(); var text = steamData != null ? steamData.SourceModInstallPath : ""; checkBoxVavleSteamSmodPath.Checked = true; checkBoxVavleSteamSmodPath.ForeColor = Color.Green; checkBoxVavleSteamSmodPath.CheckState = CheckState.Checked; txtBoxVavleSteamSmodPath.Text = text; if (txtBoxVavleSteamSmodPath.Text == @"") { checkBoxVavleSteamSmodPath.ForeColor = Color.OrangeRed; checkBoxVavleSteamSmodPath.CheckState = CheckState.Indeterminate; toolTip.SetToolTip(checkBoxVavleSteamSmodPath, "SourceModInstallPath is presented but empty!"); } } catch (Exception ex) { checkBoxVavleSteamSmodPath.Checked = checkBoxVavleSteamSmodPath.Checked = false; checkBoxVavleSteamSmodPath.ForeColor = checkBoxVavleSteamSmodPath.ForeColor = Color.Red; checkBoxVavleSteamSmodPath.CheckState = CheckState.Unchecked; txtBoxVavleSteamSmodPath.Text = @"Not found"; Console.WriteLine(ex); } }
private void CheckRegValveSteamReg() { try { // Example of using this awesome library var steamData = SteamPathsUtil.GetSteamData(); var text = steamData != null ? steamData.RegistryKey : ""; checkBoxVavleSteamReg.Checked = true; checkBoxVavleSteamReg.ForeColor = Color.Green; txtVavleSteamReg.Text = text; } catch (Exception ex) { checkBoxVavleSteamReg.Checked = checkBoxVavleSteamReg.Checked = false; checkBoxVavleSteamReg.ForeColor = checkBoxVavleSteamReg.ForeColor = Color.Red; txtVavleSteamReg.Text = @"Not found"; Console.WriteLine(ex); } }