static void Main(string[] args) { MyPrinter printer = new MyPrinter(); User u1 = new User("Meir", printer); User u2 = new User("Shlomi", printer); //printer.PageOver(); Console.WriteLine("Please enter pages to print:"); int x = int.Parse(Console.ReadLine()); printer.Print(x); }
public User(string name, MyPrinter printer) { this.name = name; myPrinter = printer; printer.PageOver += myPageOver; }