I have a method from a button click with the following code in c# (small golf scoring program I'm working on just for fun):
private void btnPlus_Click(object sender, EventArgs e)
{
btnMinus.Enabled = true;
if (f_intHoleNumber != 18) { f_intHoleNumber += 1; }
if (f_intHoleNumber == 18) { btnPlus.Enabled = false; }
txtHoleNumber.Text = f_intHoleNumber.ToString();
}
I would like to refactor that and extract another method from it so I don't reuse code but i'm not sure if its possible to pass an operator (+=) as a parameter to a method. Can this be done?