Ejemplo n.º 1
0
 public void SendPropertyChangedMessage(PropertyChangedMessage message)
 {
     if (PropChangedMessageRecevied != null)
     {
         PropChangedMessageRecevied(this, new PropertyChangedMessageEventArgs(message));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 界面显示类AGV_DisMember属性更改委托函数
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void Dis_PropertyChange(object sender, PropertyChangedEventArgs e)
 {
     AGVCar agvmember = (AGVCar)sender;
     bool sendmember = false;
     if (e.PropertyName.Equals("MarkNum"))
     {
         MarkChangeAction(agvmember);
     }
     else if (e.PropertyName.Equals("AGVStatus"))
     {
         StatusChangeAction(agvmember);
     }
     else if (e.PropertyName.Equals("WlLink"))
     {
         WLChangeAction(agvmember);
         //当无线连接成功时,发送AGV的属性信息到客户端
         //当其他属性更改时,只发送变化的属性到客户端
         if (agvmember.WlLink)
         {
             sendmember = true;
         }
     }
     else if (e.PropertyName == "AGVPower")
     {
         PowerChangeAction((AGVCar)sender);
     }
     var list = WcfDuplexMessageService.MessageService.ClientCallbackList;
     if (list == null || list.Count == 0 || typeof(AGVCar_WCF).GetProperty(e.PropertyName) == null)
         return;
     object value = typeof(AGVCar).GetProperty(e.PropertyName).GetValue(agvmember,null);
     PropertyChangedMessage message = new PropertyChangedMessage(agvmember.AGVNum, e.PropertyName, value);
     lock (list)
     {
         foreach (var client in list)
         {
             // Broadcast
             if (sendmember)
             {
                 client.SendCarMessage(agvmember.Convert2WCF());
             }
             else
             {
                 client.SendPropertyChangedMessage(message);
             }
         }
     }
 }
Ejemplo n.º 3
0
 public PropertyChangedMessageEventArgs(PropertyChangedMessage propertyMessage)
 {
     this.PropertyMessage = propertyMessage;
 }