uurha

Untitled

Oct 19th, 2021
1,158
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. public class Test
  4. {
  5.     public static void Main()
  6.     {
  7.         Action action = new Action(Method1);
  8.         var hash1 = action.GetHashCode();
  9.         action += Method2;
  10.         var hash2 = action.GetHashCode();
  11.         Console.WriteLine(hash1 == hash2);
  12.         action -= Method2;
  13.        
  14.         Console.WriteLine(hash1 == action.GetHashCode());
  15.     }
  16.    
  17.     public static void Method1(){}
  18.    
  19.     public static void Method2(){}
  20. }
RAW Paste Data