Example #1
0
 private void HandleLeftButtonUp(IPointerEventArgs e)
 {
     if (m_Pointer != null)
     {
         ISpatialDocument doc = Scene?.Document;
         if (doc != null)
         {
             m_Hits.Clear();
             Coordinate pos = Scene.ViewToWorld(m_Position);
             doc.HitTest(pos.X, pos.Y, 5, 1 / Scene.Scale,
                         m_HitTestSpec, m_Hits);
             bool multi = e.KeyModifiers.HasFlag(KeyModifiers.Shift);
             if (m_Hits.Count == 1)
             {
                 if (!multi)
                 {
                     doc.DeselectAll();
                 }
                 var          pair  = m_Hits.First();
                 IItemsLayer  layer = pair.Value;
                 ISpatialItem item  = pair.Key;
                 if (layer.IsItemSelected(item))
                 {
                     if (multi)
                     {
                         layer.DeselectItem(item);
                     }
                 }
                 else
                 {
                     layer.SelectItem(item);
                 }
             }
             else
             {
                 doc.DeselectAll();
             }
         }
     }
 }
 public LayerSelectionChangedEventArgs(IItemsLayer layer) : base(layer)
 {
 }