private void ChangeEnablalContestPower(ContestPower cp) { rb100w.IsEnabled = rb1020w.IsEnabled = rb5w.IsEnabled = rbLicense.IsEnabled = false; rb100w.IsChecked = rb1020w.IsChecked = rb5w.IsChecked = rbLicense.IsChecked = false; if (cp == ContestPower.None) { return; } if (cp.HasFlag(ContestPower.License)) { rbLicense.IsEnabled = true; } if (cp.HasFlag(ContestPower.Hundred)) { rb100w.IsEnabled = true; } if (cp.HasFlag(ContestPower.TwentyTen)) { rb1020w.IsEnabled = true; } if (cp.HasFlag(ContestPower.Five)) { rb5w.IsEnabled = true; } }
public string GetCodeDivPower(string code, ContestPower power) { if (power.HasFlag(ContestPower.TwentyTen) || GetPowerAllowed(code) == ContestPower.License) { return(code); } else { return(code.Substring(0, code.Length - 1)); } }
public string GetCodeWithPower(string code, ContestPower power) { if (power.HasFlag(ContestPower.TwentyTen) || GetPowerAllowed(code) == ContestPower.License) { return(code); } else { if (power.HasFlag(ContestPower.License)) { return(code + "H"); } else if (power.HasFlag(ContestPower.Hundred)) { return(code + "M"); } else { return(code + "P"); } } }
public string GetCodeDivPower(string code, ContestPower power) { if(power.HasFlag(ContestPower.TwentyTen) || GetPowerAllowed(code) == ContestPower.License) return code; else { return code.Substring(0, code.Length - 1); } }
public string GetCodeWithPower(string code, ContestPower power) { if(power.HasFlag(ContestPower.TwentyTen) || GetPowerAllowed(code) == ContestPower.License) return code; else { if(power.HasFlag(ContestPower.License)) return code + "H"; else if(power.HasFlag(ContestPower.Hundred)) return code + "M"; else return code + "P"; } }
private void ChangeEnablalContestPower(ContestPower cp) { rb100w.IsEnabled = rb1020w.IsEnabled = rb5w.IsEnabled = rbLicense.IsEnabled = false; rb100w.IsChecked = rb1020w.IsChecked = rb5w.IsChecked = rbLicense.IsChecked = false; if (cp == ContestPower.None) return; if (cp.HasFlag(ContestPower.License)) rbLicense.IsEnabled = true; if (cp.HasFlag(ContestPower.Hundred)) rb100w.IsEnabled = true; if (cp.HasFlag(ContestPower.TwentyTen)) rb1020w.IsEnabled = true; if (cp.HasFlag(ContestPower.Five)) rb5w.IsEnabled = true; }