?? attributequery.cs
字號:
/*
Copyright 1995-2005 ESRI
All rights reserved under the copyright laws of the United States.
You may freely redistribute and use this sample code, with or without modification.
Disclaimer: THE SAMPLE CODE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ESRI OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) SUSTAINED BY YOU OR A THIRD PARTY, HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ARISING IN ANY
WAY OUT OF THE USE OF THIS SAMPLE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
For additional information contact: Environmental Systems Research Institute, Inc.
Attn: Contracts Dept.
380 New York Street
Redlands, California, U.S.A. 92373
Email: contracts@esri.com
*/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.ReaderControl;
namespace AttributeQuery
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class AttributeQuery : System.Windows.Forms.Form
{
private AxMSFlexGridLib.AxMSFlexGrid axMSFlexGrid1;
private AxMSFlexGridLib.AxMSFlexGrid axMSFlexGrid2;
private ESRI.ArcGIS.ReaderControl.AxReaderControl axReaderControl1;
private System.Windows.Forms.Button cmdMeetZoomTo;
private System.Windows.Forms.Button cmdMeetCenterAt;
private System.Windows.Forms.Button cmdMeetFlash;
private System.Windows.Forms.Button cmdFailZoomTo;
private System.Windows.Forms.Button cmdFailCenterAt;
private System.Windows.Forms.Button cmdFailFlash;
private System.Windows.Forms.Button cmdOpen;
private System.Windows.Forms.RadioButton optZoomIn;
private System.Windows.Forms.RadioButton optZoomOut;
private System.Windows.Forms.RadioButton optPan;
private System.Windows.Forms.Button cmdFullExtent;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.GroupBox grpBox;
private System.Windows.Forms.RadioButton optString;
private System.Windows.Forms.RadioButton optNumber;
private System.Windows.Forms.ComboBox cboOperator;
private System.Windows.Forms.ComboBox cboFields;
private System.Windows.Forms.ComboBox cboLayers;
private System.Windows.Forms.TextBox txtValue;
private System.Windows.Forms.Label lblMeets;
private System.Windows.Forms.Label lblFails;
private System.Windows.Forms.Button cmdQuery;
private System.Windows.Forms.Label lblLayerToQuery;
private System.Windows.Forms.Label lblFieldType;
private System.Windows.Forms.Label lblField;
private System.Windows.Forms.Label lblOperator;
private System.Windows.Forms.Label lblValue;
private System.Collections.Hashtable m_LayersIndex;
private ARFeatureSet m_arFeatureSetMeets;
private ARFeatureSet m_arFeatureSetFails;
private m_InverseOperators[] InverseOperator = new m_InverseOperators[7];
private ESRI.ArcGIS.LicenseControl.AxLicenseControl axLicenseControl1;
private System.ComponentModel.Container components = null;
struct m_InverseOperators
{
public string input;
public string inverse;
}
public AttributeQuery()
{
// Required for Windows Form Designer support
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AttributeQuery));
this.axMSFlexGrid1 = new AxMSFlexGridLib.AxMSFlexGrid();
this.axMSFlexGrid2 = new AxMSFlexGridLib.AxMSFlexGrid();
this.axReaderControl1 = new ESRI.ArcGIS.ReaderControl.AxReaderControl();
this.cmdMeetZoomTo = new System.Windows.Forms.Button();
this.cmdMeetCenterAt = new System.Windows.Forms.Button();
this.cmdMeetFlash = new System.Windows.Forms.Button();
this.cmdFailZoomTo = new System.Windows.Forms.Button();
this.cmdFailCenterAt = new System.Windows.Forms.Button();
this.cmdFailFlash = new System.Windows.Forms.Button();
this.cmdOpen = new System.Windows.Forms.Button();
this.optZoomIn = new System.Windows.Forms.RadioButton();
this.optZoomOut = new System.Windows.Forms.RadioButton();
this.optPan = new System.Windows.Forms.RadioButton();
this.cmdFullExtent = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.grpBox = new System.Windows.Forms.GroupBox();
this.lblValue = new System.Windows.Forms.Label();
this.lblOperator = new System.Windows.Forms.Label();
this.lblField = new System.Windows.Forms.Label();
this.lblFieldType = new System.Windows.Forms.Label();
this.lblLayerToQuery = new System.Windows.Forms.Label();
this.cmdQuery = new System.Windows.Forms.Button();
this.txtValue = new System.Windows.Forms.TextBox();
this.cboLayers = new System.Windows.Forms.ComboBox();
this.optString = new System.Windows.Forms.RadioButton();
this.optNumber = new System.Windows.Forms.RadioButton();
this.cboOperator = new System.Windows.Forms.ComboBox();
this.cboFields = new System.Windows.Forms.ComboBox();
this.lblMeets = new System.Windows.Forms.Label();
this.lblFails = new System.Windows.Forms.Label();
this.axLicenseControl1 = new ESRI.ArcGIS.LicenseControl.AxLicenseControl();
((System.ComponentModel.ISupportInitialize)(this.axMSFlexGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.axMSFlexGrid2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.axReaderControl1)).BeginInit();
this.grpBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.axLicenseControl1)).BeginInit();
this.SuspendLayout();
//
// axMSFlexGrid1
//
this.axMSFlexGrid1.Location = new System.Drawing.Point(8, 384);
this.axMSFlexGrid1.Name = "axMSFlexGrid1";
this.axMSFlexGrid1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMSFlexGrid1.OcxState")));
this.axMSFlexGrid1.Size = new System.Drawing.Size(344, 104);
this.axMSFlexGrid1.TabIndex = 0;
//
// axMSFlexGrid2
//
this.axMSFlexGrid2.Location = new System.Drawing.Point(360, 384);
this.axMSFlexGrid2.Name = "axMSFlexGrid2";
this.axMSFlexGrid2.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axMSFlexGrid2.OcxState")));
this.axMSFlexGrid2.Size = new System.Drawing.Size(344, 104);
this.axMSFlexGrid2.TabIndex = 1;
//
// axReaderControl1
//
this.axReaderControl1.Location = new System.Drawing.Point(8, 48);
this.axReaderControl1.Name = "axReaderControl1";
this.axReaderControl1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axReaderControl1.OcxState")));
this.axReaderControl1.Size = new System.Drawing.Size(536, 304);
this.axReaderControl1.TabIndex = 2;
//
// cmdMeetZoomTo
//
this.cmdMeetZoomTo.Location = new System.Drawing.Point(8, 488);
this.cmdMeetZoomTo.Name = "cmdMeetZoomTo";
this.cmdMeetZoomTo.Size = new System.Drawing.Size(112, 24);
this.cmdMeetZoomTo.TabIndex = 3;
this.cmdMeetZoomTo.Text = "Zoom To";
this.cmdMeetZoomTo.Click += new System.EventHandler(this.MixedDisplayResults_Click);
//
// cmdMeetCenterAt
//
this.cmdMeetCenterAt.Location = new System.Drawing.Point(128, 488);
this.cmdMeetCenterAt.Name = "cmdMeetCenterAt";
this.cmdMeetCenterAt.Size = new System.Drawing.Size(112, 24);
this.cmdMeetCenterAt.TabIndex = 4;
this.cmdMeetCenterAt.Text = "Center At";
this.cmdMeetCenterAt.Click += new System.EventHandler(this.MixedDisplayResults_Click);
//
// cmdMeetFlash
//
this.cmdMeetFlash.Location = new System.Drawing.Point(248, 488);
this.cmdMeetFlash.Name = "cmdMeetFlash";
this.cmdMeetFlash.Size = new System.Drawing.Size(104, 24);
this.cmdMeetFlash.TabIndex = 5;
this.cmdMeetFlash.Text = "Flash";
this.cmdMeetFlash.Click += new System.EventHandler(this.MixedDisplayResults_Click);
//
// cmdFailZoomTo
//
this.cmdFailZoomTo.Location = new System.Drawing.Point(360, 488);
this.cmdFailZoomTo.Name = "cmdFailZoomTo";
this.cmdFailZoomTo.Size = new System.Drawing.Size(112, 24);
this.cmdFailZoomTo.TabIndex = 6;
this.cmdFailZoomTo.Text = "Zoom To";
this.cmdFailZoomTo.Click += new System.EventHandler(this.MixedDisplayResults_Click);
//
// cmdFailCenterAt
//
this.cmdFailCenterAt.Location = new System.Drawing.Point(480, 488);
this.cmdFailCenterAt.Name = "cmdFailCenterAt";
this.cmdFailCenterAt.Size = new System.Drawing.Size(112, 24);
this.cmdFailCenterAt.TabIndex = 7;
this.cmdFailCenterAt.Text = "Center At";
this.cmdFailCenterAt.Click += new System.EventHandler(this.MixedDisplayResults_Click);
//
// cmdFailFlash
//
this.cmdFailFlash.Location = new System.Drawing.Point(600, 488);
this.cmdFailFlash.Name = "cmdFailFlash";
this.cmdFailFlash.Size = new System.Drawing.Size(104, 24);
this.cmdFailFlash.TabIndex = 8;
this.cmdFailFlash.Text = "Flash";
this.cmdFailFlash.Click += new System.EventHandler(this.MixedDisplayResults_Click);
//
// cmdOpen
//
this.cmdOpen.Location = new System.Drawing.Point(8, 8);
this.cmdOpen.Name = "cmdOpen";
this.cmdOpen.Size = new System.Drawing.Size(72, 24);
this.cmdOpen.TabIndex = 9;
this.cmdOpen.Text = "Open";
this.cmdOpen.Click += new System.EventHandler(this.cmdOpen_Click);
//
// optZoomIn
//
this.optZoomIn.Appearance = System.Windows.Forms.Appearance.Button;
this.optZoomIn.Location = new System.Drawing.Point(80, 8);
this.optZoomIn.Name = "optZoomIn";
this.optZoomIn.Size = new System.Drawing.Size(72, 24);
this.optZoomIn.TabIndex = 10;
this.optZoomIn.Text = "Zoom In";
this.optZoomIn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.optZoomIn.Click += new System.EventHandler(this.MixedControls_Click);
//
// optZoomOut
//
this.optZoomOut.Appearance = System.Windows.Forms.Appearance.Button;
this.optZoomOut.Location = new System.Drawing.Point(152, 8);
this.optZoomOut.Name = "optZoomOut";
this.optZoomOut.Size = new System.Drawing.Size(72, 24);
this.optZoomOut.TabIndex = 11;
this.optZoomOut.Text = "Zoom Out";
this.optZoomOut.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.optZoomOut.Click += new System.EventHandler(this.MixedControls_Click);
//
// optPan
//
this.optPan.Appearance = System.Windows.Forms.Appearance.Button;
this.optPan.Location = new System.Drawing.Point(296, 8);
this.optPan.Name = "optPan";
this.optPan.Size = new System.Drawing.Size(72, 24);
this.optPan.TabIndex = 13;
this.optPan.Text = "Pan";
this.optPan.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.optPan.Click += new System.EventHandler(this.MixedControls_Click);
//
// cmdFullExtent
//
this.cmdFullExtent.Location = new System.Drawing.Point(224, 8);
this.cmdFullExtent.Name = "cmdFullExtent";
this.cmdFullExtent.Size = new System.Drawing.Size(72, 24);
this.cmdFullExtent.TabIndex = 14;
this.cmdFullExtent.Text = "Full Extent";
this.cmdFullExtent.Click += new System.EventHandler(this.cmdFullExtent_Click);
//
// grpBox
//
this.grpBox.Controls.Add(this.lblValue);
this.grpBox.Controls.Add(this.lblOperator);
this.grpBox.Controls.Add(this.lblField);
this.grpBox.Controls.Add(this.lblFieldType);
this.grpBox.Controls.Add(this.lblLayerToQuery);
this.grpBox.Controls.Add(this.cmdQuery);
this.grpBox.Controls.Add(this.txtValue);
this.grpBox.Controls.Add(this.cboLayers);
this.grpBox.Controls.Add(this.optString);
this.grpBox.Controls.Add(this.optNumber);
this.grpBox.Controls.Add(this.cboOperator);
this.grpBox.Controls.Add(this.cboFields);
this.grpBox.Location = new System.Drawing.Point(560, 40);
this.grpBox.Name = "grpBox";
this.grpBox.Size = new System.Drawing.Size(144, 312);
this.grpBox.TabIndex = 20;
this.grpBox.TabStop = false;
this.grpBox.Text = "Query Criteria";
//
// lblValue
//
this.lblValue.Location = new System.Drawing.Point(8, 224);
this.lblValue.Name = "lblValue";
this.lblValue.Size = new System.Drawing.Size(120, 16);
this.lblValue.TabIndex = 31;
this.lblValue.Text = "Value:";
//
// lblOperator
//
this.lblOperator.Location = new System.Drawing.Point(8, 176);
this.lblOperator.Name = "lblOperator";
this.lblOperator.Size = new System.Drawing.Size(88, 16);
this.lblOperator.TabIndex = 30;
this.lblOperator.Text = "Operator:";
//
// lblField
//
this.lblField.Location = new System.Drawing.Point(8, 128);
this.lblField.Name = "lblField";
this.lblField.Size = new System.Drawing.Size(96, 16);
this.lblField.TabIndex = 29;
this.lblField.Text = "Field to Query:";
//
// lblFieldType
//
this.lblFieldType.Location = new System.Drawing.Point(8, 80);
this.lblFieldType.Name = "lblFieldType";
this.lblFieldType.Size = new System.Drawing.Size(104, 16);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -