Hello friends,
I am new to C# and try to learn the basics. I am getting error "error CS0052: Inconsistent accessibility: field the 'Model.Notifier' is less accessible than field 'Model.notifyViews'"
Could you please let me know the error I am getting...
using System;
using System.Data;
class Model
{
delegate void Notifier(string sender);
public event Notifier notifyViews;
public void Change()
{
notifyViews("Model");
}
}
class View1
{
public View1(Model m)
{
m.notifyViews += new Notifier(this.Update1);
}
void Update1(string sender)
{
Console.WriteLine(sender + " was changed");
}
}
class View2
{
public View2(Model m)
{
m.notifyViews += new Notifier(this.Update2);
}
void Update2(string sender)
{
Console.WriteLine(sender + " was changed");
}
}
class Test
{
static void Main()
{
Model m = new Model();
new View1(m);
new View2(m);
m.Change();
}
}