Example #1
0
        private void SelectedWellsTreeView_OnSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if (e.RemovedItems.Count > 0)
            {
                Graphic g = e.RemovedItems[0] as Graphic;
                g.UnSelect();
                g.SetZIndex(0);
            }

            if (e.AddedItems.Count > 0)
            {
                Graphic g = e.AddedItems[0] as Graphic;
                g.Select();
                g.SetZIndex(1);

                //Relationship query
                RelationshipParameter relationshipParameters = new RelationshipParameter()
                {
                    ObjectIds           = new int[] { Convert.ToInt32(g.Attributes[SelectedWellsTreeView.Tag as string]) },
                    OutFields           = new string[] { "OBJECTID, API_NUMBER, ELEVATION, FORMATION, TOP" },
                    RelationshipId      = 3,
                    OutSpatialReference = MyMap.SpatialReference
                };

                queryTask.ExecuteRelationshipQueryAsync(relationshipParameters);
            }
        }
Example #2
0
        private void SelectedWellsTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            if (e.OldValue != null)
            {
                Graphic g = e.OldValue as Graphic;
                g.UnSelect();
                g.SetZIndex(0);
            }

            if (e.NewValue != null)
            {
                Graphic g = e.NewValue as Graphic;
                g.Select();
                g.SetZIndex(1);

                //Relationship query
                RelationshipParameter relationshipParameters = new RelationshipParameter()
                {
                    ObjectIds           = new int[] { Convert.ToInt32(g.Attributes[SelectedWellsTreeView.Tag as string]) },
                    OutFields           = new string[] { "OBJECTID, API_NUMBER, ELEVATION, FORMATION, TOP" },
                    RelationshipId      = 3,
                    OutSpatialReference = MyMap.SpatialReference
                };

                queryTask.ExecuteRelationshipQueryAsync(relationshipParameters);
            }
        }
        /// <summary>
        /// Remove selection.
        /// </summary>
        /// <param name="graphic">Graphic to remove selection.</param>
        public void DoUnselect(Graphic graphic)
        {
            int zIndex = graphic.GetZIndex();

            graphic.UnSelect();
            zIndex = zIndex ^ SELECTEDZINDEX;
            graphic.SetZIndex(zIndex);
        }
        void Row_MouseLeave(object sender, MouseEventArgs e)
        {
            DataGridRow row = sender as DataGridRow;
            Graphic     g   = ((System.Windows.FrameworkElement)(sender)).DataContext as Graphic;

            if (!QueryDetailsDataGrid.SelectedItems.Contains(g))
            {
                g.UnSelect();
            }
        }
Example #5
0
        private void FeatureLayer_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs e)
        {
            if (_lastGraphic != null)
            {
                _lastGraphic.UnSelect();
            }

            e.Graphic.Select();
            if (e.Graphic.Selected)
            {
                MyDataGrid.ScrollIntoView(e.Graphic, null);
            }

            _lastGraphic = e.Graphic;
        }
 private void LeftFeatureLink_MouseLeave(object sender, MouseEventArgs e)
 {
     if (sender is SimpleLinkButton)
     {
         SimpleLinkButton fLink = sender as SimpleLinkButton;
         if (!fLink.IsActive)
         {
             Graphic feature = (Graphic)fLink.Tag;
             if (feature != null)
             {
                 feature.UnSelect();
             }
         }
     }
 }
Example #7
0
 /// <summary>
 /// Unhooks mouse events and stops tracking vertex dragging
 /// </summary>
 private void StopTracking()
 {
     MyMap.MouseLeave        -= MyMap_MouseLeave;
     MyMap.MouseMove         -= Map_MouseMove;
     MyMap.MouseLeftButtonUp -= Map_MouseLeftButtonUp;
     MyMap.KeyDown           -= MyMap_KeyDown;
     MyMap.Cursor             = Cursors.Arrow;
     fromPoint = null;
     if (DraggingVertex == null)
     {
         return;
     }
     //DraggingVertex.Symbol = VertexSymbol;
     DraggingVertex.UnSelect();
     DraggingVertex = null;
     if (activeGraphic != null && activeGraphic.Geometry is MapPoint)
     {
         StopEdit();
     }
 }
 /// <summary>
 /// Remove selection.
 /// </summary>
 /// <param name="graphic">Graphic to remove selection.</param>
 public void DoUnselect(Graphic graphic)
 {
     int zIndex = graphic.GetZIndex();
     graphic.UnSelect();
     zIndex = zIndex ^ SELECTEDZINDEX;
     graphic.SetZIndex(zIndex);
 }