private void RefreshCoordinate() { this.listBox1.Items.Clear(); this.listView1.Clear(); this.m_pGeometry = this.m_pEditFeature.ShapeCopy; string shapeFieldName = (this.m_pEditFeature.Class as IFeatureClass).ShapeFieldName; int index = this.m_pEditFeature.Fields.FindField(shapeFieldName); IGeometryDef geometryDef = this.m_pEditFeature.Fields.get_Field(index).GeometryDef; this.m_HasM = geometryDef.HasM; this.m_HasZ = geometryDef.HasZ; this.SetStatus(); LVColumnHeader header = new LVColumnHeader { Text = "序号", Width = 80 }; this.listView1.Columns.Add(header); header = new LVColumnHeader { ColumnStyle = ListViewColumnStyle.EditBox, Text = "x", Width = 80 }; this.listView1.Columns.Add(header); header = new LVColumnHeader { ColumnStyle = ListViewColumnStyle.EditBox, Text = "y", Width = 80 }; this.listView1.Columns.Add(header); if (this.m_HasZ) { header = new LVColumnHeader { ColumnStyle = ListViewColumnStyle.EditBox, Text = "z", Width = 80 }; this.listView1.Columns.Add(header); } if (this.m_HasM) { header = new LVColumnHeader { ColumnStyle = ListViewColumnStyle.EditBox, Text = "m", Width = 80 }; this.listView1.Columns.Add(header); } if (this.m_pGeometry.GeometryType == esriGeometryType.esriGeometryPoint) { this.listBox1.Items.Add(0); } else if (this.m_pGeometry.GeometryType == esriGeometryType.esriGeometryMultipoint) { this.listBox1.Items.Add(0); } else { IGeometryCollection pGeometry = this.m_pGeometry as IGeometryCollection; for (int i = 0; i < pGeometry.GeometryCount; i++) { this.listBox1.Items.Add(i); } } this.listBox1.SelectedIndex = 0; }
/// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmStaticByGeometry)); this.label1 = new Label(); this.cboLayers = new ComboBoxEdit(); this.label3 = new Label(); this.groupBox1 = new GroupBox(); this.btnDelete = new SimpleButton(); this.btnSelectField = new SimpleButton(); this.cboFields = new ComboBoxEdit(); this.label4 = new Label(); this.listView1 = new EditListView(); this.columnHeader1 = new LVColumnHeader(); this.columnHeader2 = new LVColumnHeader(); this.cboClassField = new ComboBoxEdit(); this.btnCancel = new SimpleButton(); this.btnOK = new SimpleButton(); this.listView2 = new ListView(); ((ISupportInitialize)this.cboLayers.Properties).BeginInit(); this.groupBox1.SuspendLayout(); ((ISupportInitialize)this.cboFields.Properties).BeginInit(); ((ISupportInitialize)this.cboClassField.Properties).BeginInit(); base.SuspendLayout(); this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(8, 16); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(29, 12); this.label1.TabIndex = 0; this.label1.Text = "图层"; this.cboLayers.EditValue = ""; this.cboLayers.Location = new System.Drawing.Point(64, 8); this.cboLayers.Name = "cboLayers"; this.cboLayers.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) }); this.cboLayers.Size = new System.Drawing.Size(224, 21); this.cboLayers.TabIndex = 1; this.cboLayers.SelectedIndexChanged += new EventHandler(this.cboLayers_SelectedIndexChanged); this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(8, 48); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(53, 12); this.label3.TabIndex = 10; this.label3.Text = "分类字段"; this.groupBox1.Controls.Add(this.btnDelete); this.groupBox1.Controls.Add(this.btnSelectField); this.groupBox1.Controls.Add(this.cboFields); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.listView1); this.groupBox1.Location = new System.Drawing.Point(8, 72); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(296, 152); this.groupBox1.TabIndex = 11; this.groupBox1.TabStop = false; this.groupBox1.Text = "统计字段"; this.btnDelete.Enabled = false; this.btnDelete.Image = (Image)resources.GetObject("btnDelete.Image"); this.btnDelete.Location = new System.Drawing.Point(256, 88); this.btnDelete.Name = "btnDelete"; this.btnDelete.Size = new System.Drawing.Size(24, 24); this.btnDelete.TabIndex = 13; this.btnDelete.Click += new EventHandler(this.btnDelete_Click); this.btnSelectField.Enabled = false; this.btnSelectField.Image = (Image)resources.GetObject("btnSelectField.Image"); this.btnSelectField.Location = new System.Drawing.Point(256, 56); this.btnSelectField.Name = "btnSelectField"; this.btnSelectField.Size = new System.Drawing.Size(24, 24); this.btnSelectField.TabIndex = 12; this.btnSelectField.Click += new EventHandler(this.btnSelectField_Click); this.cboFields.EditValue = ""; this.cboFields.Location = new System.Drawing.Point(56, 24); this.cboFields.Name = "cboFields"; this.cboFields.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) }); this.cboFields.Size = new System.Drawing.Size(192, 21); this.cboFields.TabIndex = 11; this.cboFields.SelectedIndexChanged += new EventHandler(this.cboFields_SelectedIndexChanged); this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(8, 24); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(29, 12); this.label4.TabIndex = 10; this.label4.Text = "字段"; this.listView1.Columns.AddRange(new ColumnHeader[] { this.columnHeader1, this.columnHeader2 }); this.listView1.ComboBoxBgColor = Color.White; this.listView1.ComboBoxFont = new System.Drawing.Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 134); this.listView1.EditBgColor = Color.White; this.listView1.EditFont = new System.Drawing.Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 134); this.listView1.FullRowSelect = true; this.listView1.GridLines = true; this.listView1.Location = new System.Drawing.Point(8, 56); this.listView1.LockRowCount = 0; this.listView1.Name = "listView1"; this.listView1.Size = new System.Drawing.Size(240, 88); this.listView1.TabIndex = 9; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = View.Details; this.listView1.SelectedIndexChanged += new EventHandler(this.listView1_SelectedIndexChanged); this.columnHeader1.ColumnStyle = ListViewColumnStyle.ReadOnly; this.columnHeader1.Text = "字段"; this.columnHeader1.Width = 109; this.columnHeader2.ColumnStyle = ListViewColumnStyle.ReadOnly; this.columnHeader2.Text = "统计类型"; this.columnHeader2.Width = 125; this.cboClassField.EditValue = ""; this.cboClassField.Location = new System.Drawing.Point(64, 40); this.cboClassField.Name = "cboClassField"; this.cboClassField.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) }); this.cboClassField.Size = new System.Drawing.Size(224, 21); this.cboClassField.TabIndex = 9; this.cboClassField.SelectedIndexChanged += new EventHandler(this.cboClassField_SelectedIndexChanged); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Location = new System.Drawing.Point(264, 344); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(48, 24); this.btnCancel.TabIndex = 22; this.btnCancel.Text = "关闭"; this.btnOK.Enabled = false; this.btnOK.Location = new System.Drawing.Point(32, 344); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(48, 24); this.btnOK.TabIndex = 21; this.btnOK.Text = "统计"; this.btnOK.Click += new EventHandler(this.btnOK_Click); this.listView2.Location = new System.Drawing.Point(8, 232); this.listView2.Name = "listView2"; this.listView2.Size = new System.Drawing.Size(296, 96); this.listView2.TabIndex = 23; this.listView2.UseCompatibleStateImageBehavior = false; this.listView2.View = View.Details; this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); base.ClientSize = new System.Drawing.Size(320, 373); base.Controls.Add(this.listView2); base.Controls.Add(this.btnCancel); base.Controls.Add(this.btnOK); base.Controls.Add(this.label3); base.Controls.Add(this.label1); base.Controls.Add(this.groupBox1); base.Controls.Add(this.cboClassField); base.Controls.Add(this.cboLayers); base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "frmStaticByGeometry"; this.Text = "统计"; base.Load += new EventHandler(this.frmStaticByGeometry_Load); ((ISupportInitialize)this.cboLayers.Properties).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((ISupportInitialize)this.cboFields.Properties).EndInit(); ((ISupportInitialize)this.cboClassField.Properties).EndInit(); base.ResumeLayout(false); base.PerformLayout(); }