我有以下代码
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.
如果我选择大写、小写和反向复选框,那么它只会显示反向功能的结果。
我delegate
的在下面
delegate string StringOperations(string str);
我正在使用多播委托并返回string
,如上面的代码所示。请让我知道我做错了什么?