Пример #1
0
 public bool AddPhoneNumber(PhoneNumber phoneNumber)
 {
     if (phoneNumber == null)
     {
         return(false);
     }
     if (PhoneNumbers.Contains(phoneNumber))
     {
         return(false);
     }
     PhoneNumbers.Add(phoneNumber);
     return(true);
 }
 /// <summary>
 /// 清空,再次绘制,区分选中与未选中的
 /// 1、绘制矩形时调用
 /// 2、根据时间检索之后,也会再次绘制(清除矩形)
 /// </summary>
 private void DrawAgain(bool clearRectangle = false)
 {
     _graphicsLayer.Graphics.Clear(); //清空
     for (var n = 0; n < TouristsList.Count; ++n)
     {
         var tourist = TouristsList[n];
         PictureMarkerSymbol symbol;                                                                          //重新绘制
         if (PhoneNumbers != null && PhoneNumbers.Count != 0 && PhoneNumbers.Contains(tourist.User.PhoneNum)) //选中的项
         {
             symbol = (touristAgent as IRenderGraphic).CreatSymbol <PictureMarkerSymbol>(new Uri(Global.LocalSelectMarkerUrl));
         }
         else
         {
             symbol = (touristAgent as IRenderGraphic).CreatSymbol <PictureMarkerSymbol>(new Uri(Global.LocalMarkerUrl));
         }
         var graphic = (touristAgent as IRenderGraphic).CreateGraphic(n, symbol, tourist);
         _graphicsLayer.Graphics.Add(graphic);
     }
     if (clearRectangle)
     {
         ClearRectangle();
     }
 }