I have below code
StringOperations sumString, reverseString, lowerString, upperString, multicastString; sumString = new StringOperations(sum); reverseString = new StringOperations(reverse); lowerString = new StringOperations(lower); upperString = new StringOperations(upper); multicastString = upperString + lowerString + reverseString + sumString; int count = 4; if (!checkBox1.Checked) { multicastString -= upperString; count--; } if (!checkBox2.Checked) { multicastString -= reverseString; count--; } if (!checkBox3.Checked) { multicastString -= lowerString; count--; } if (!checkBox4.Checked) { multicastString -= sumString; count--; } if (count > 0) { string test = multicastString(textBox1.Text); }
If the upper and lower case flags are selected, this only displays the result of the bottom line.
If I select uppercase, lowercase, and reverse flags in upper case, then it will show me the result of the inverse function.
My delegate is below
delegate string StringOperations(string str);
I use the multicast delegate and return a string as shown in the code above. Please let me know what I am doing wrong?
source share