コード例 #1
0
ファイル: FrmNewXZZ.cs プロジェクト: zhongshuiyuan/gews
        private void btndel_Click(object sender, EventArgs e)
        {
            if (this.Tag == null || this.Text != "修改小柱状")
            {
                MessageBox.Show("请先使用修改按钮选中要删除的小柱状");
                return;
            }
            string bid       = this.Tag.ToString();
            var    AnnoLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_AnnotationXZZ) as IFeatureLayer; //注记图层
            var    lineLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_PolylineXZZ) as IFeatureLayer;   //线源图层
            var    topLayer  = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_PolygonXZZ) as IFeatureLayer;    //外部图形图层

            if (AnnoLayer == null || lineLayer == null || topLayer == null)
            {
                return;
            }
            DataEditCommon.DeleteFeatureByBId(AnnoLayer, bid);
            DataEditCommon.DeleteFeatureByBId(lineLayer, bid);
            DataEditCommon.DeleteFeatureByBId(topLayer, bid);
            FrmNewXZZ frm = new FrmNewXZZ();

            frm.Show(this.Owner);
            frm.Location = this.Location;
            this.Close();
            DataEditCommon.g_pAxMapControl.CurrentTool = null;
        }
コード例 #2
0
 public ToolUpdateXZZ(FrmNewXZZ form)
 {
     Form = form;
     //
     // TODO: Define values for the public properties
     //
     base.m_category = ""; //localizable text
     base.m_caption = "";  //localizable text
     base.m_message = "";  //localizable text
     base.m_toolTip = "";  //localizable text
     base.m_name = "";   //unique id, non-localizable (e.g. "MyCategory_MyTool")
     try
     {
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap");
     }
 }
コード例 #3
0
 public ToolUpdateXZZ(FrmNewXZZ form)
 {
     Form = form;
     //
     // TODO: Define values for the public properties
     //
     base.m_category = ""; //localizable text
     base.m_caption  = ""; //localizable text
     base.m_message  = ""; //localizable text
     base.m_toolTip  = ""; //localizable text
     base.m_name     = ""; //unique id, non-localizable (e.g. "MyCategory_MyTool")
     try
     {
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap");
     }
 }
コード例 #4
0
 private void btndel_Click(object sender, EventArgs e)
 {
     if (this.Tag == null || this.Text != "修改小柱状")
     {
         MessageBox.Show("请先使用修改按钮选中要删除的小柱状");
         return;
     }
     string bid = this.Tag.ToString();
     var AnnoLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_AnnotationXZZ) as IFeatureLayer;//注记图层
     var lineLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_PolylineXZZ) as IFeatureLayer;//线源图层
     var topLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_PolygonXZZ) as IFeatureLayer; //外部图形图层
     if (AnnoLayer == null || lineLayer == null || topLayer == null)
     {
         return;
     }
     DataEditCommon.DeleteFeatureByBId(AnnoLayer, bid);
     DataEditCommon.DeleteFeatureByBId(lineLayer, bid);
     DataEditCommon.DeleteFeatureByBId(topLayer, bid);
     FrmNewXZZ frm = new FrmNewXZZ();
     frm.Show(this.Owner);
     frm.Location = this.Location;
     this.Close();
     DataEditCommon.g_pAxMapControl.CurrentTool = null;
 }
コード例 #5
0
ファイル: FrmNewXZZ.cs プロジェクト: zhongshuiyuan/gews
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         //去除无用空行
         for (int i = 0; i < dgrdvZhzzt.RowCount - 1; i++)
         {
             if (this.dgrdvZhzzt.Rows[i].Cells[0].Value == null &&
                 this.dgrdvZhzzt.Rows[i].Cells[1].Value == null &&
                 this.dgrdvZhzzt.Rows[i].Cells[2].Value == null)
             {
                 this.dgrdvZhzzt.Rows.RemoveAt(i);
             }
         }
         //验证
         if (!check())
         {
             this.DialogResult = DialogResult.None;
             return;
         }
         this.DialogResult = DialogResult.OK;
         string bid = IDGenerator.NewBindingID();
         //实体赋值
         IPoint pt = new PointClass();
         pt.X = Convert.ToDouble(txtX.Text);
         pt.Y = Convert.ToDouble(txtY.Text);
         pt.Z = 0;
         double bili = Convert.ToDouble(txtBlc.Text);
         //List<double> list = new List<double>();
         var datasources = new List <KeyValuePair <int, double> >();
         for (int i = 0; i < dgrdvZhzzt.RowCount - 1; i++)
         {
             DataGridViewTextBoxCell  cell  = dgrdvZhzzt.Rows[i].Cells[0] as DataGridViewTextBoxCell;
             DataGridViewComboBoxCell cell1 = dgrdvZhzzt.Rows[i].Cells[1] as DataGridViewComboBoxCell;
             //list.Add(Convert.ToDouble(cell.Value.ToString()));
             int key = 0;
             if (cell1.Value.ToString() == "煤层")
             {
                 key = 1;
             }
             datasources.Add(new KeyValuePair <int, double>(key, Convert.ToDouble(cell.Value.ToString())));
         }
         //list.Add(Convert.ToDouble(txtDBBG.Text));
         datasources.Add(new KeyValuePair <int, double>(2, Convert.ToDouble(txtDBBG.Text)));
         if (this.Text.Equals("修改小柱状") && this.Tag != null)
         {
             bid = this.Tag.ToString();
             var AnnoLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_AnnotationXZZ) as IFeatureLayer; //注记图层
             var lineLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_PolylineXZZ) as IFeatureLayer;   //线源图层
             var topLayer  = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_PolygonXZZ) as IFeatureLayer;    //外部图形图层
             if (AnnoLayer == null || lineLayer == null || topLayer == null)
             {
                 System.Windows.Forms.MessageBox.Show("小柱状图层缺失!");
                 return;
             }
             DataEditCommon.DeleteFeatureByBId(AnnoLayer, bid);
             DataEditCommon.DeleteFeatureByBId(lineLayer, bid);
             DataEditCommon.DeleteFeatureByBId(topLayer, bid);
         }
         if (DrawXZZ.drawXZZ(datasources, pt, Convert.ToDouble(txtAngle.Text), bid, bili))
         {
             FrmNewXZZ frm = new FrmNewXZZ();
             frm.Show(this.Owner);
             frm.Location = this.Location;
             this.Close();
             DataEditCommon.g_pAxMapControl.CurrentTool = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #6
0
 //小柱状
 private void mniXZZ_ItemClick(object sender, ItemClickEventArgs e)
 {
     var frm = new FrmNewXZZ();
     frm.Show(this);
 }
コード例 #7
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         //去除无用空行
         for (int i = 0; i < dgrdvZhzzt.RowCount - 1; i++)
         {
             if (this.dgrdvZhzzt.Rows[i].Cells[0].Value == null &&
                 this.dgrdvZhzzt.Rows[i].Cells[1].Value == null &&
                 this.dgrdvZhzzt.Rows[i].Cells[2].Value == null)
             {
                 this.dgrdvZhzzt.Rows.RemoveAt(i);
             }
         }
         this.DialogResult = DialogResult.OK;
         string bid = IdGenerator.NewBindingId();
         //实体赋值
         IPoint pt = new PointClass();
         pt.X = Convert.ToDouble(txtX.Text);
         pt.Y = Convert.ToDouble(txtY.Text);
         pt.Z = 0;
         double bili = Convert.ToDouble(txtBlc.Text);
         //List<double> list = new List<double>();
         var datasources = new List<KeyValuePair<int, double>>();
         for (int i = 0; i < dgrdvZhzzt.RowCount - 1; i++)
         {
             DataGridViewTextBoxCell cell = dgrdvZhzzt.Rows[i].Cells[0] as DataGridViewTextBoxCell;
             DataGridViewComboBoxCell cell1 = dgrdvZhzzt.Rows[i].Cells[1] as DataGridViewComboBoxCell;
             //list.Add(Convert.ToDouble(cell.Value.ToString()));
             int key=0;
             if(cell1.Value.ToString()=="煤层")
                 key=1;
             datasources.Add(new KeyValuePair<int, double>(key, Convert.ToDouble(cell.Value.ToString())));
         }
         //list.Add(Convert.ToDouble(txtDBBG.Text));
         datasources.Add(new KeyValuePair<int, double>(2, Convert.ToDouble(txtDBBG.Text)));
         if (this.Text.Equals("修改小柱状") && this.Tag != null)
         {
             bid = this.Tag.ToString();
             var AnnoLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_AnnotationXZZ) as IFeatureLayer;//注记图层
             var lineLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_PolylineXZZ) as IFeatureLayer;//线源图层
             var topLayer = DataEditCommon.GetLayerByName(DataEditCommon.g_pMap, LayerNames.LAYER_ALIAS_MR_PolygonXZZ) as IFeatureLayer; //外部图形图层
             if (AnnoLayer == null || lineLayer == null || topLayer == null)
             {
                 System.Windows.Forms.MessageBox.Show("小柱状图层缺失!");
                 return;
             }
             DataEditCommon.DeleteFeatureByBId(AnnoLayer,bid);
             DataEditCommon.DeleteFeatureByBId(lineLayer, bid);
             DataEditCommon.DeleteFeatureByBId(topLayer, bid);
         }
         if (DrawXZZ.drawXZZ(datasources, pt, Convert.ToDouble(txtAngle.Text), bid, bili))
         {
             FrmNewXZZ frm = new FrmNewXZZ();
             frm.Show(this.Owner);
             frm.Location = this.Location;
             this.Close();
             DataEditCommon.g_pAxMapControl.CurrentTool = null;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }