Callbacks "Inconsistent Accessibility" Error
[Sorry about the lack of paragraphing. I did use it but then it seems to disappear when I click post/update]
Hi guys,
I am trying to make this program in C# but I have hit a little problem. I have a "form manager" which is responsible for creating two different forms. The first is a log in where the user enters their details, the second is a display form where some details are shown.
I am trying to create a callback to a method inside my form manager, which is invoked when the user clicks the "log in" button on the first form. The trouble is, I get the error "Inconsistent Accessibility [...] FormManager.LoginCallback is less accessible than LoginForm.SetLoginCallback(FormManager.LoginCallback)"
Im not too sure what the issue is, I was hoping I could get some help on it here. My FormManager code is:
//Create Delegate for Callback
public delegate void LoginCallback(String sUsername, String sPassword);
public void Init()
{
LoginCallback cback = new LoginCallback(this.DoLogin);
LoginForm fLogin = new LoginForm();
fLogin.SetLoginCallback(cback);
fLogin.Show();
}
DoLogin is the actual function that the callback should point to.
In my LoginForm I literally just have this as the method taking the callback parameter:
public void SetLoginCallback(FormManager.LoginCallback cback) { }
A private variable in the LoginForm will be set to the passed in "cback" eventually, however I can't compile the application at the minute because of this error.
If anyone can shed some light on this issue I would really appreciate it.