Example #1
0
        private DateTime m_timeLastLeftButtonUp = DateTime.Now;//鼠标左键弹起的时间,判断双击用
        /// <summary>
        /// 鼠标在DataGrid弹起事件回调
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            DateTime b = DateTime.Now;
            long     c = CommFun.TimeDiff(b, m_timeLastLeftButtonUp);

            m_timeLastLeftButtonUp = b;
            if (c < 280)
            {//双击事件
                if (m_graphicsLayer != null && m_graphics != null)
                {
                    m_graphicsLayer.RemoveGraphics(m_graphics);
                    m_graphics = null;
                }
                DataGrid grid = sender as DataGrid;
                if (grid != null && grid.SelectedItem is BindClass && grid.Tag is TmpInfo && m_graphicsLayer != null)
                {
                    CGetObjByID getGeo = new CGetObjByID();
                    getGeo.MapDocIndex = 0;
                    getGeo.LayerIndex  = (grid.Tag as TmpInfo).LayerIndex;
                    getGeo.FeatureID   = Convert.ToInt32((grid.SelectedItem as BindClass).key0);
                    COpenMap openmap = new COpenMap();
                    openmap.MapName = new string[1] {
                        activeMapDoc.MapDocName
                    };
                    getGeo.MapName = openmap;
                    activeMapDoc.GetGeomByID(getGeo, new UploadStringCompletedEventHandler(FlashFeature));
                }
            }
        }
Example #2
0
 /// <summary>
 /// 关闭
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Close(object sender, RoutedEventArgs e)
 {
     if (GraphicsLayer != null && m_graphics != null)
     {
         GraphicsLayer.RemoveGraphics(m_graphics);
         m_graphics = null;
     }
     this.Close();
 }
 private void ClearRoad()
 {
     if (m_road != null && GraphicsLayer != null)
     {
         GraphicsLayer.RemoveGraphics(m_road);
         m_road = null;
     }
     if (this.m_markLayer != null)
     {
         for (int i = 0; i < m_stopList.Count; i++)
         {
             m_markLayer.RemoveMark(m_stopList[i]);
         }
         m_stopList.Clear();
     }
 }
Example #4
0
 public void Clear()
 {
     if (m_road != null && GraphicsLayer != null)
     {
         GraphicsLayer.RemoveGraphics(m_road);
         m_road = null;
     }
     if (MarkLayer != null)
     {
         for (int i = 0; i < m_stopList.Count; i++)
         {
             MarkLayer.RemoveMark(m_stopList[i]);
         }
         //m_stopList.Clear();
     }
 }
 /// <summary>
 /// 闪烁完毕回调
 /// </summary>
 /// <param name="g"></param>
 private void FlickerOverCallback(GraphicsBase g)
 {
     m_graphicsLayer.RemoveGraphics(m_graphics);
     m_graphics = null;
     if (MessageBox.Show("查询成功。是否添加该要素?", "查询并闪烁成功", MessageBoxButton.OKCancel) == MessageBoxResult.OK)//"提示",Alert.YES|Alert.NO , this , onAlert , null , Alert.NO);
     {
         if (set == 0)
         {
             this._firstFeature        = geoObj;
             this.radioButton1.Content = "获取第一个区要素(已获取)";
         }
         if (set == 1)
         {
             this._secondFeature       = geoObj;
             this.radioButton2.Content = "获取第二个区要素(已获取)";
         }
     }
 }
Example #6
0
 private void EditPoint(object sender, RoutedEventArgs e)
 {
     if (GraphicsLayer != null)
     {
         if (m_graphics != null)
         {
             GraphicsLayer.RemoveGraphics(m_graphics);
             m_graphics = null;
         }
         CGetObjByID getGeo = new CGetObjByID();
         getGeo.MapDocIndex = 0;
         getGeo.LayerIndex  = ActiveMapDoc.ActiveLayerIndex;
         getGeo.FeatureID   = m_featureID;
         COpenMap openmap = new COpenMap();
         openmap.MapName = new string[1] {
             ActiveMapDoc.MapDocName
         };
         getGeo.MapName = openmap;
         ActiveMapDoc.GetGeomByID(getGeo, new UploadStringCompletedEventHandler(DrawFeature));
     }
 }
Example #7
0
 private void Clear()
 {
     if (GraphicsLayer != null && m_graphics != null)
     {
         GraphicsLayer.RemoveGraphics(m_graphics);
         m_graphics = null;
     }
     this.grid1.RowDefinitions.Clear();
     this.grid1.Children.Clear();
     this.grid2.Children.Clear();
     this.grid3.ColumnDefinitions.Clear();
     this.grid3.Children.Clear();
     this.grid3.ColumnDefinitions.Add(new ColumnDefinition()
     {
         Width = new GridLength(75)
     });
     this.grid3.ColumnDefinitions.Add(new ColumnDefinition()
     {
         Width = new GridLength(75)
     });
     m_textBoxArr.Clear();
 }
Example #8
0
        private void SubmitForEdit(object sender, RoutedEventArgs e)
        {
            if (GraphicsLayer != null && m_graphics != null)
            {
                SFeatureGeometry geoObj = m_targetGeo as SFeatureGeometry;
                int n = 0;
                if (geoObj != null)
                {
                    if (geoObj.LinGeom != null && geoObj.LinGeom.Length > 0)
                    {
                        List <Point> pntArr = new List <Point>();
                        for (int i = 0; i < geoObj.LinGeom.Length; i++)
                        {
                            for (int j = 0; j < geoObj.LinGeom[i].Line.Arcs.Length; j++)
                            {
                                for (int k = 0; k < geoObj.LinGeom[i].Line.Arcs[j].Dots.Length; k++)
                                {
                                    geoObj.LinGeom[i].Line.Arcs[j].Dots[k].x = m_graphics.Points[n].X;
                                    geoObj.LinGeom[i].Line.Arcs[j].Dots[k].y = m_graphics.Points[n++].Y;
                                }
                            }
                        }
                    }
                    if (geoObj.PntGeom != null && geoObj.PntGeom.Length > 0)
                    {
                        geoObj.PntGeom[0].Dot.x = m_graphics.Points[0].X;
                        geoObj.PntGeom[0].Dot.y = m_graphics.Points[0].Y;
                    }
                    if (geoObj.RegGeom != null && geoObj.RegGeom.Length > 0)
                    {
                        List <Point> pntArr = new List <Point>();
                        for (int i = 0; i < geoObj.RegGeom[0].Rings.Length; i++)
                        {
                            for (int j = 0; j < geoObj.RegGeom[0].Rings[i].Arcs.Length; j++)
                            {
                                for (int k = 0; k < geoObj.RegGeom[0].Rings[i].Arcs[j].Dots.Length; k++)
                                {
                                    geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].x = m_graphics.Points[n].X;
                                    geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].y = m_graphics.Points[n++].Y;
                                }
                            }
                        }
                    }
                }
                GraphicsLayer.RemoveGraphics(m_graphics);
                m_graphics = null;
            }
            CMapFeatureInfo fIno = GetMapFeatureInfo();

            if (fIno == null)
            {
                return;
            }
            ActiveMapDoc.UpdateFeature(fIno, new UploadStringCompletedEventHandler((s, evt) =>
            {
                if (m_mapDocDataViewer != null)
                {
                    m_mapDocDataViewer.UpdateRecord(fIno.FSet.AttValue);
                }
                GetEditOperResult(s, evt);
            }));
        }