public ExistingShapefile2_constant(string shapefileName, string featuretype, IApplication m_application) { InitializeComponent(); m_app = m_application; IMap map = ArcTimData.GetMap(m_application); ShapeFile shp = new ShapeFile(ArcTimData.StaticClass.infoTable.Rows[0]["ShapefilePath"].ToString() + "\\" + shapefileName + ".shp"); DataTable attTable = shp.AttributeTable; int numCol = attTable.Columns.Count; for (int i = 0; i < numCol; i++) { this.comboBox1.Items.Add(attTable.Columns[i].ColumnName); } shpFileName = shapefileName; }
public void loadCBox(IApplication m_app) { ILayer pLyr; IMap map = ArcTimData.GetMap(m_app); if (map != null) { int iLyrCount = map.LayerCount; for (int i = 0; i < iLyrCount; i++) { pLyr = map.get_Layer(i); if (pLyr is IFeatureLayer) { this.comboBox_SF1.Items.Add(pLyr.Name); this.comboBox_SF2.Items.Add(pLyr.Name); this.comboBox_SF3.Items.Add(pLyr.Name); this.comboBox_SF4.Items.Add(pLyr.Name); this.comboBox_SF5.Items.Add(pLyr.Name); this.comboBox_SF6.Items.Add(pLyr.Name); } } } }
public void getOutputSettings() { DataTable dt = new DataTable(); double xmax = 0, xmin = 0, ymax = 0, ymin = 0; double nx = Convert.ToDouble(textBox_xCells.Text), ny = Convert.ToDouble(textBox_yCells.Text); double dx = Convert.ToDouble(textBox_cellsize.Text); dt.Columns.Add("MinExtents"); dt.Columns.Add("MaxExtents"); dt.Columns.Add("NumCells"); dt.Columns.Add("Delta"); IMap map = ArcTimData.GetMap(m_application); IActiveView ia = m_hookHelper2.ActiveView; //get extents data if (radioButton_useCurrentExtents.Checked == true) { xmax = ia.Extent.XMax; xmin = ia.Extent.XMin; ymax = ia.Extent.YMax; ymin = ia.Extent.YMin; } else if (radioButton_defineExtents.Checked == true) { xmax = Convert.ToDouble(textBox_xmax.Text); xmin = Convert.ToDouble(textBox_xmin.Text); ymax = Convert.ToDouble(textBox_ymax.Text); ymin = Convert.ToDouble(textBox_ymin.Text); } //get res data if (radioButton_res.Checked == true) { if (radioButton_reslow.Checked == true) { dx = 0.01; } if (radioButton_resmed.Checked == true) { dx = 0.008; } if (radioButton_reshigh.Checked == true) { dx = 0.004; } double xtemp = 0, ytemp = 0, tempnx = 0, tempny = 0; tempnx = Math.Truncate((xmax - xmin) * dx); tempny = Math.Truncate((ymax - ymin) * dx); //xtemp = delx*resx; //nx = Math.Truncate(delx/xtemp); //if(delx%xtemp!=0) //{ // nx = Math.Truncate(delx/xtemp)+1; // delx = nx*xtemp; // ny = Math.Truncate(delx/xtemp)+1; // dely = nx*xtemp; //} //xmax = nx*xtemp+xmin; //ymax = nx*xtemp+ymin; dx = (xmax - xmin) / tempnx; nx = tempnx; ny = tempny; } DataRow rx = dt.NewRow(); DataRow ry = dt.NewRow(); rx[0] = xmin; ry[0] = ymin; rx[1] = xmax; ry[1] = ymax; rx[2] = nx; ry[2] = ny; rx[3] = dx; ry[3] = dx; dt.Rows.Add(rx); dt.Rows.Add(ry); ArcTimData.StaticClass.outputPropTable = dt; ArcTimData.StaticClass.outputPropTable.TableName = "OutputSettings"; }