B
Ben R. Bolton
I have two projects each with a different namespace. The first defines an
interface with two methods.
namespace SWPStandards
{
public interface ISWPDisplayMessage
{
void DisplayMessage(string message);
void DisplayMessage(string message, bool popUp);
}
}
the second implements the interface.
namespace BRBWinTester
{
public class Form1 :
System.Windows.Forms.Form,ISWPDisplayMessage,ISWPHandleException
{
...
public void DisplayMessage(string message, bool popUp)
{
statusBar1.Text = message;
if (popUp)
MessageBox.Show(message);
}
void DisplayMessage(string message)
{
DisplayMessage(message,SWP.Const.NoPopUP);
}
}
}
I have implemented the two required methods one both without qualifying the
method with SWPStandards.ISWPDisplayMessage. Why does the compiler generate
the following exception?
'BRBWinTester.Form1' does not implement interface member
'SWPStandards.ISWPDisplayMessage.DisplayMessage(string)'.
'BRBWinTester.Form1.DisplayMessage(string)' is either static, not public, or
has the wrong return type.
Why doesn't it generate the same message for the other method?
Any assistance would be appreciated.
interface with two methods.
namespace SWPStandards
{
public interface ISWPDisplayMessage
{
void DisplayMessage(string message);
void DisplayMessage(string message, bool popUp);
}
}
the second implements the interface.
namespace BRBWinTester
{
public class Form1 :
System.Windows.Forms.Form,ISWPDisplayMessage,ISWPHandleException
{
...
public void DisplayMessage(string message, bool popUp)
{
statusBar1.Text = message;
if (popUp)
MessageBox.Show(message);
}
void DisplayMessage(string message)
{
DisplayMessage(message,SWP.Const.NoPopUP);
}
}
}
I have implemented the two required methods one both without qualifying the
method with SWPStandards.ISWPDisplayMessage. Why does the compiler generate
the following exception?
'BRBWinTester.Form1' does not implement interface member
'SWPStandards.ISWPDisplayMessage.DisplayMessage(string)'.
'BRBWinTester.Form1.DisplayMessage(string)' is either static, not public, or
has the wrong return type.
Why doesn't it generate the same message for the other method?
Any assistance would be appreciated.