Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Event test
//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; class Base { public static void Boo() {Console.WriteLine("Boo!");} public static void Do() {Console.WriteLine("DoBase!");} } class Derived : Base { public static void Do() {Console.WriteLine("DoDerived!");} public static event Action<int> SomethingChanged; private static HashSet<Action<int>> includeInSomethingChanged = new HashSet<Action<int>>(); public static void IncludeInSuperSomethingChanged(Action<int> callback) { includeInSomethingChanged.Add(callback); } public static void OnSomethingChanged(bool isSuperSomethingChanged) { foreach (Action<int> callback in SomethingChanged.GetInvocationList()) { if (!isSuperSomethingChanged || includeInSomethingChanged.Contains(callback)) { callback(2); } } } } namespace Rextester { public class Program { public static void Main(string[] args) { new Program().Run(); } public void Run() { //Your code goes here Console.WriteLine("Hello, world!"); Derived.Boo(); Derived.Do(); Derived.SomethingChanged += OnSomethingChanged; Derived.SomethingChanged += OnSuperSomethingChanged; Derived.IncludeInSuperSomethingChanged(OnSuperSomethingChanged); Derived.OnSomethingChanged(false); Derived.OnSomethingChanged(true); } void OnSomethingChanged(int i) { Console.WriteLine(i); } void OnSuperSomethingChanged(int i) { Console.WriteLine("Super!" + i); } } }
run
|
edit
|
history
|
help
0
Dijkstra’s shortest path algorithm
Demonstration await Control returned to the Caller
OOOO1
Overriding fields
lilnq 1
Game_snake
BreakNum
How to Count Occurrences of a Word in a String (LINQ) (C#)
Daily Coding Problem: Problem #1
Test