Warnings when using delegate inference in Visual Studio 2005 en ReSharper Build 210

One of the new features in .NET 2.0 is Delegate Inference and ReSharper
Build 210 shows warning when using delegate inferences.

Eg

// Note: this is just a sample do not wonder what I would use this code for
:)

private delegate void InvokeTest(object sender);
private void testjeButton_Click(object sender, EventArgs e)
{
InvokeTest invokeTestje1 = Testje1; // This shows a warning saying that
Testje1 is being used without parenthesis
Testje1(new ListBox());
}

private void Testje1(object sender)
{
ListBox listBox1 = sender as ListBox;
if (listBox1 == null)
{
return;
}
listBox1.SelectedIndex = -1;
}

Gabriel Lozano-Morán
MCSD .NET
Real Software
http://www.realdn.net
http://www.realsoftware.be


1 comment
Comment actions Permalink

This is a known problem. I can't promise that it will be fixed in the next
build, but by the release it would be.

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Gabriel Lozano-Morán" <gabriel@no-spam.org> wrote in message
news:dlqgig$ka0$1@is.intellij.net...

One of the new features in .NET 2.0 is Delegate Inference and ReSharper
Build 210 shows warning when using delegate inferences.

>

Eg

>

// Note: this is just a sample do not wonder what I would use this code
for :)

>

private delegate void InvokeTest(object sender);
private void testjeButton_Click(object sender, EventArgs e)
{
InvokeTest invokeTestje1 = Testje1; // This shows a warning saying
that Testje1 is being used without parenthesis
Testje1(new ListBox());
}

>

private void Testje1(object sender)
{
ListBox listBox1 = sender as ListBox;
if (listBox1 == null)
{
return;
}
listBox1.SelectedIndex = -1;
}

>

Gabriel Lozano-Morán
MCSD .NET
Real Software
http://www.realdn.net
http://www.realsoftware.be



0

Please sign in to leave a comment.