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
How do I calculate someone's age in C#?
RHGFEC WQWQW
subtração
gyakorlas
count the string
Main3
test1
reverse linked list
Modulul 3, Exerciţiul 2 – Crearea şi utilizarea unui tip struct
Intuit // C# // listing_4.6 (if_then_else // Shooting on the target)