コード例 #1
0
 public IEnumerator <ITask> SubscribeHandler(battery.Subscribe subscribe)
 {
     yield return
         (SubscribeHelper(this.batterySubMgr, subscribe.Body, subscribe.ResponsePort).Choice(
              success =>
              SendNotificationToTarget(
                  subscribe.Body.Subscriber, this.batterySubMgr, new battery.Replace(this.batteryState)),
              EmptyHandler));
 }
コード例 #2
0
        public virtual IEnumerator <ITask> GenericSubscribeHandler(pxbattery.Subscribe subscribe)
        {
            base.SubscribeHelper(_subMgrPort, subscribe.Body, subscribe.ResponsePort);

            if (_state.TimeStamp != DateTime.MinValue)
            {
                SendNotificationToTarget <pxbattery.Replace>(subscribe.Body.Subscriber, _subMgrPort, _state.SyncGenericState(ref _genericState));
            }

            yield break;
        }
コード例 #3
0
ファイル: LegoNXTBattery.cs プロジェクト: yingted/Myro
 public IEnumerator <ITask> SubscribeHandler(battery.Subscribe subscribe)
 {
     yield return(Arbiter.Choice(
                      SubscribeHelper(_subMgrPort, subscribe.Body, subscribe.ResponsePort),
                      delegate(SuccessResult success)
     {
         SendNotification <battery.Replace>(_subMgrPort, subscribe.Body.Subscriber, new battery.Replace(_state));
     },
                      delegate(Exception fault)
     {
         LogError(fault);
     }
                      ));
 }