Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Events
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); var tower = new ClockTower(); var john = new Person("John", tower); tower.ChimeFivePM(); tower.ChimeSixAM(); } } public class Person { private string _name; private ClockTower _tower; public Person(string name, ClockTower tower) { _name = name; _tower = tower; _tower.Chime += (object sender, ClockEventArgs args) => Console.WriteLine("{0} headed the clock chime at {1}", _name, args.Time); } } public class ClockEventArgs : EventArgs { public int Time { get; set; } } public delegate void ChimeEventHandler(object sender, ClockEventArgs args); public class ClockTower { public event ChimeEventHandler Chime; public void ChimeFivePM() { Chime(this, new ClockEventArgs { Time = 17 }); } public void ChimeSixAM() { Chime(this, new ClockEventArgs { Time = 6 }); } } }
run
|
edit
|
history
|
help
0
math 10.97
example
Y Fibonnoci
601
ElaineBrown
Сортировка массива
Remove BOLD formatting from html
EVEN AND ODD
Test
Class