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);
}
When uppercase and lowercase checkboxes are selected then it only show me lowercase function's result.
If I select uppercase, lowercase and reverse checkboxes then it only show me result of reverse function.
My delegate
is below
delegate string StringOperations(string str);
I am using multicast delegate and returning string
as shown in above code. Please let me know what I am doing wrong?