C# 클래스 Sym.EventsManager.MsgEvent

消息订阅-发布的操作类
파일 보기 프로젝트 열기: GISMaster/MsgEvent

공개 메소드들

메소드 설명
Receive ( string msgType, EventHandler func, object receiver = null, bool isOnce = false ) : void

订阅消息

RemoveListener ( string msgType, EventHandler func, object receiver = null ) : void

移除消息的订阅

Send ( MsgEventArgs args, object sender = null ) : void

发送消息

Send ( string msgType, object data, object sender = null ) : void

发送消息

메소드 상세

Receive() 공개 정적인 메소드

订阅消息
public static Receive ( string msgType, EventHandler func, object receiver = null, bool isOnce = false ) : void
msgType string 信道ID
func EventHandler 用于处理接收到消息的方法
receiver object 订阅者对象,默认为null
isOnce bool 是否接收方法只处理一次,默认为false
리턴 void

RemoveListener() 공개 정적인 메소드

移除消息的订阅
public static RemoveListener ( string msgType, EventHandler func, object receiver = null ) : void
msgType string 信道ID
func EventHandler 需要移除的接收消息处理方法
receiver object 订阅者对象,默认为null
리턴 void

Send() 공개 정적인 메소드

发送消息
public static Send ( MsgEventArgs args, object sender = null ) : void
args MsgEventArgs 消息体对象
sender object 发送者对象
리턴 void

Send() 공개 정적인 메소드

发送消息
public static Send ( string msgType, object data, object sender = null ) : void
msgType string 信道ID
data object 消息数据
sender object 发送者对象
리턴 void