protected void OnOverflow(int mertek) { /*if (this.Overflow != null) * { * // masik szal * Overflow(this, new OverflowEventArgs(mertek)); * // jobb: EventArgs.Empty * // new EventArgs() * }*/ // immputable: Delagate, MulticastDelegate //OverflowHandler temp = this.Overflow; // thread safe atomic muveletek OverflowHandler temp = Interlocked.CompareExchange(ref this.Overflow, null, null); // Interlocked.CompareExchange(ref a, b, c) // old=a; if(a==c) a=b; return old; /*long a = 500; * a += 1000; */ if (temp != null) { temp(this, new OverflowEventArgs(mertek)); } }
public TIMA(OverflowHandler handler) : base() { OnOverflow += handler; }