コード例 #1
0
        public static void NotifyDeleted(RemoteType remoteType, object id)
        {
            var arg       = CreateEventArg(remoteType, id);
            var eventName = RemoteObjectDeleted.GetEventName(remoteType);

            EventPortal.Publish(eventName, arg);
        }
コード例 #2
0
        private static void SubscribeEvents()
        {
            var remoteTypes = RemoteType.GetTypes();

            foreach (var remoteType in remoteTypes)
            {
                RemoteObjectUpdated.Subscribe(remoteType);
                RemoteObjectDeleted.Subscribe(remoteType);
            }
        }
コード例 #3
0
        /// <summary>
        /// 取消订阅
        /// </summary>
        private static void CancelEvents()
        {
            var remoteTypes = RemoteType.GetTypes();

            foreach (var remoteType in remoteTypes)
            {
                //取消订阅对象被修改和删除的事件
                RemoteObjectUpdated.Cancel(remoteType);
                RemoteObjectDeleted.Cancel(remoteType);
            }
        }