12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Uestc.Auto6.Dso.Core
- {
- public interface IBroadcaster
- {
- event EventHandler<CustomEventArg>? PublisherChanged;
- static event EventHandler<CustomEventArg>? StaticPublisherChanged;
- virtual void OnRaiseCustomEvent(CustomEventArg e) { }
- static void OnRaiseStaticCustomEvent(CustomEventArg e)
- {
- EventHandler<CustomEventArg>? handler = StaticPublisherChanged;
- if (handler != null)
- {
- handler(e,e);
- }
- }
- }
- public class CustomEventArg : EventArgs
- {
- public CustomEventArg(String s)
- {
- Message = s;
- }
- private string message = "";
- public String Message
- {
- get { return message; }
- set { message = value; }
- }
- }
- }
|