📄 frmmain.cs
字号:
myDataAdapter.SelectCommand.CommandText = "Select * From AAT Order By ARCID";
myDataAdapter.Fill(_environment.m_dataSet,"AAT");
myDataAdapter.SelectCommand.CommandText = "Select * From NAT Order By NODEID";
myDataAdapter.Fill(_environment.m_dataSet,"NAT");
myConnection.Close();
}
//装载索引信息
void LoadIndexInfos(int nIndex)
{
string szIndexTable = _environment.m_mapInfos[nIndex].szIndexTable;
System.Data.DataTable mapsTbl = this._environment.m_dataSet.Tables[szIndexTable];
System.Data.DataRow[] rowsMaps = mapsTbl.Select();
_environment.m_nIndexNum = rowsMaps.Length;
_environment.m_indexInfos = null;
_environment.m_indexInfos = new IndexInfo[_environment.m_nIndexNum];
int nIdx = 0;
foreach (System.Data.DataRow myRow in rowsMaps)
{
_environment.m_indexInfos[nIdx].szName = myRow["名称"].ToString();
// _environment.m_indexInfos[nIdx].dX = (double)myRow["X坐标"];
// _environment.m_indexInfos[nIdx].dY = (double)myRow["Y坐标"];
_environment.m_indexInfos[nIdx].m_extent = new MapObjects2.Rectangle();
_environment.m_indexInfos[nIdx].m_extent.Top = (double)myRow["Y1"];
_environment.m_indexInfos[nIdx].m_extent.Bottom = (double)myRow["Y2"];
_environment.m_indexInfos[nIdx].m_extent.Right = (double)myRow["X2"];
_environment.m_indexInfos[nIdx].m_extent.Left = (double)myRow["X1"];
nIdx ++;
}
}
//装载图层信息
void LoadLayerInfos(int nIndex)
{
string szMetaTable = _environment.m_mapInfos[nIndex].szMetaTable;
System.Data.DataTable mapsTbl = this._environment.m_dataSet.Tables[szMetaTable];
System.Data.DataRow[] rowsMaps = mapsTbl.Select("存在=true","显示次序1,显示次序2,id");
_environment.m_nLayerNum = rowsMaps.Length;
_environment.m_layerInfos = null;
_environment.m_layerInfos = new LayerInfo[_environment.m_nLayerNum];
int nIdx = 0;
foreach (System.Data.DataRow myRow in rowsMaps)
{
_environment.m_layerInfos[nIdx].szName = myRow["名称"].ToString();
_environment.m_layerInfos[nIdx].szType = myRow["大类"].ToString();
_environment.m_layerInfos[nIdx].szFileName = myRow["图形文件"].ToString();
_environment.m_layerInfos[nIdx].szSubType = myRow["中类"].ToString();
_environment.m_layerInfos[nIdx].szTableName = myRow["属性表名"].ToString();
_environment.m_layerInfos[nIdx].szLayerName = myRow["图层名"].ToString();
_environment.m_layerInfos[nIdx].bVisible = (bool)myRow["显示"];
_environment.m_layerInfos[nIdx].bLable = (bool)myRow["注记"];
_environment.m_layerInfos[nIdx].bCanSelected = (bool)myRow["选择"];
_environment.m_layerInfos[nIdx].bCanControl = (bool)myRow["控制"];
_environment.m_layerInfos[nIdx].bBackground = (bool)myRow["地物"];
if (myRow["小类"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].szSubType2 = myRow["小类"].ToString();
else
_environment.m_layerInfos[nIdx].szSubType2 = "";
if (myRow["次小类"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].szSubType3 = myRow["次小类"].ToString();
else
_environment.m_layerInfos[nIdx].szSubType3 = "";
if (myRow["注记比例尺"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].dScale = (double)myRow["注记比例尺"];
else
_environment.m_layerInfos[nIdx].dScale = 999999999;
if (myRow["显示比例尺"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].dShowScale = (double)myRow["显示比例尺"];
else
_environment.m_layerInfos[nIdx].dShowScale = 999999999;
if (myRow["符号索引"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].nCharacterIndex = (int)myRow["符号索引"];
else
_environment.m_layerInfos[nIdx].nCharacterIndex = -1;
if (myRow["注记大小"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].nFontSize = (int)myRow["注记大小"];
else
_environment.m_layerInfos[nIdx].nFontSize = 10;
if (myRow["字体名称"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].szFontName = myRow["字体名称"].ToString() ;
else
_environment.m_layerInfos[nIdx].szFontName = "";
if (myRow["符号大小"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].nSymSize = (int)myRow["符号大小"];
else
_environment.m_layerInfos[nIdx].nSymSize = 4;
if (myRow["符号颜色"] != System.DBNull.Value)
{
int nColor = (int)myRow["符号颜色"];
_environment.m_layerInfos[nIdx].nSymColor = (uint)nColor;//;
}
else
{
_environment.m_layerInfos[nIdx].nSymColor = CEnvironment.SYMBOL_COLOR_NONE;
}
if (myRow["字段名"] != System.DBNull.Value)
_environment.m_layerInfos[nIdx].szFieldName = myRow["字段名"].ToString();
else
_environment.m_layerInfos[nIdx].szFieldName = "单位名称";
if (_environment.m_layerInfos[nIdx].szLayerName.Equals("公交车站"))
{
_environment.m_szfntStation = _environment.m_layerInfos[nIdx].szFontName;
_environment.m_chStation = (char)_environment.m_layerInfos[nIdx].nCharacterIndex;
_environment.m_nfntStation = _environment.m_layerInfos[nIdx].nFontSize;
}
nIdx ++;
}
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
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()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
this._comboBox = new System.Windows.Forms.ComboBox();
this._panelBus = new System.Windows.Forms.Panel();
this._bus_checkBox7 = new System.Windows.Forms.CheckBox();
this._bus_checkBox6 = new System.Windows.Forms.CheckBox();
this._bus_checkBox5 = new System.Windows.Forms.CheckBox();
this._bus_checkBox4 = new System.Windows.Forms.CheckBox();
this._bus_checkBox3 = new System.Windows.Forms.CheckBox();
this._bus_checkBox2 = new System.Windows.Forms.CheckBox();
this._bus_checkBox1 = new System.Windows.Forms.CheckBox();
this._bus_button = new System.Windows.Forms.Button();
this._Bus_listBox = new System.Windows.Forms.ListBox();
this._Bus_radioButton_Line = new System.Windows.Forms.RadioButton();
this._Bus_radioButton_Station = new System.Windows.Forms.RadioButton();
this._Bus_textBox = new System.Windows.Forms.TextBox();
this._panelDist = new System.Windows.Forms.Panel();
this._dis_label_Note = new System.Windows.Forms.Label();
this._dist_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
this._dist_comboBoxFilter = new System.Windows.Forms.ComboBox();
this._dist_button = new System.Windows.Forms.Button();
this._dist_radioButton2 = new System.Windows.Forms.RadioButton();
this._dist_radioButton1 = new System.Windows.Forms.RadioButton();
this._dist_comboBoxPos = new System.Windows.Forms.ComboBox();
this._dist_label1 = new System.Windows.Forms.Label();
this._dist_txtName = new System.Windows.Forms.TextBox();
this._panelIndex = new System.Windows.Forms.Panel();
this._index_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
this._index_listBox = new System.Windows.Forms.ListBox();
this._index_comboBoxFilter = new System.Windows.Forms.ComboBox();
this._index_txtName = new System.Windows.Forms.TextBox();
this._index_label2 = new System.Windows.Forms.Label();
this._index_label1 = new System.Windows.Forms.Label();
this._panelOutput = new System.Windows.Forms.Panel();
this._output_button3 = new System.Windows.Forms.Button();
this._output_button2 = new System.Windows.Forms.Button();
this._output_button1 = new System.Windows.Forms.Button();
this._output_listBox = new System.Windows.Forms.ListBox();
this._Output_label = new System.Windows.Forms.Label();
this._panelQuery = new System.Windows.Forms.Panel();
this._query_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
this._query_button = new System.Windows.Forms.Button();
this._query_checkBox3 = new System.Windows.Forms.CheckBox();
this._query_checkBox2 = new System.Windows.Forms.CheckBox();
this._query_checkBox1 = new System.Windows.Forms.CheckBox();
this._query_comboBoxFilter = new System.Windows.Forms.ComboBox();
this._query_txtTel = new System.Windows.Forms.TextBox();
this._query_txtName = new System.Windows.Forms.TextBox();
this._query_label3 = new System.Windows.Forms.Label();
this._query_label2 = new System.Windows.Forms.Label();
this._query_label1 = new System.Windows.Forms.Label();
this._timer = new System.Windows.Forms.Timer(this.components);
this._toolBar16 = new System.Windows.Forms.ToolBar();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel4 = new System.Windows.Forms.StatusBarPanel();
this._statusBar = new System.Windows.Forms.StatusBar();
this._toolBar2 = new System.Windows.Forms.ToolBar();
this._map = new AxMapObjects2.AxMap();
this._picToolTip = new System.Windows.Forms.PictureBox();
this._lblToolTip = new System.Windows.Forms.Label();
this._panelBus.SuspendLayout();
this._panelDist.SuspendLayout();
this._panelIndex.SuspendLayout();
this._panelOutput.SuspendLayout();
this._panelQuery.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this._map)).BeginInit();
this.SuspendLayout();
//
// _comboBox
//
this._comboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this._comboBox.Items.AddRange(new object[] {
"100%",
"200%",
"400%",
"800%",
"1600%"});
this._comboBox.Location = new System.Drawing.Point(504, 472);
this._comboBox.Name = "_comboBox";
this._comboBox.Size = new System.Drawing.Size(96, 20);
this._comboBox.TabIndex = 7;
this._comboBox.SelectionChangeCommitted += new System.EventHandler(this._comboBox_SelectionChangeCommitted_1);
//
// _panelBus
//
this._panelBus.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left);
this._panelBus.Controls.AddRange(new System.Windows.Forms.Control[] {
this._bus_checkBox7,
this._bus_checkBox6,
this._bus_checkBox5,
this._bus_checkBox4,
this._bus_checkBox3,
this._bus_checkBox2,
this._bus_checkBox1,
this._bus_button,
this._Bus_listBox,
this._Bus_radioButton_Line,
this._Bus_radioButton_Station,
this._Bus_textBox});
this._panelBus.Location = new System.Drawing.Point(248, 91);
this._panelBus.Name = "_panelBus";
this._panelBus.Size = new System.Drawing.Size(208, 317);
this._panelBus.TabIndex = 9;
this._panelBus.Visible = false;
//
// _bus_checkBox7
//
this._bus_checkBox7.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
this._bus_checkBox7.Checked = true;
this._bus_checkBox7.CheckState = System.Windows.Forms.CheckState.Checked;
this._bus_checkBox7.Location = new System.Drawing.Point(8, 264);
this._bus_checkBox7.Name = "_bus_checkBox7";
this._bus_checkBox7.Size = new System.Drawing.Size(64, 24);
this._bus_checkBox7.TabIndex = 27;
this._bus_checkBox7.Text = "地铁";
this._bus_checkBox7.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
//
// _bus_checkBox6
//
this._bus_checkBox6.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
this._bus_checkBox6.Checked = true;
this._bus_checkBox6.CheckState = System.Windows.Forms.CheckState.Checked;
this._bus_checkBox6.Location = new System.Drawing.Point(136, 240);
this._bus_checkBox6.Name = "_bus_checkBox6";
this._bus_checkBox6.Size = new System.Drawing.Size(64, 24);
this._bus_checkBox6.TabIndex = 26;
this._bus_checkBox6.Text = "夜班车";
this._bus_checkBox6.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
//
// _bus_checkBox5
//
this._bus_checkBox5.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
this._bus_checkBox5.Checked = true;
this._bus_checkBox5.CheckState = System.Windows.Forms.CheckState.Checked;
this._bus_checkBox5.Location = new System.Drawing.Point(136, 216);
this._bus_checkBox5.Name = "_bus_checkBox5";
this._bus_checkBox5.Size = new System.Drawing.Size(64, 24);
this._bus_checkBox5.TabIndex = 25;
this._bus_checkBox5.Text = "长途车";
this._bus_checkBox5.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
//
// _bus_checkBox4
//
this._bus_checkBox4.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
this._bus_checkBox4.Checked = true;
this._bus_checkBox4.CheckState = System.Windows.Forms.CheckState.Checked;
this._bus_checkBox4.Location = new System.Drawing.Point(64, 240);
this._bus_checkBox4.Name = "_bus_checkBox4";
this._bus_checkBox4.Size = new System.Drawing.Size(88, 24);
this._bus_checkBox4.TabIndex = 24;
this._bus_checkBox4.Text = "巴士专线";
this._bus_checkBox4.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
//
// _bus_checkBox3
//
this._bus_checkBox3.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
this._bus_checkBox3.Checked = true;
this._bus_checkBox3.CheckState = System.Windows.Forms.CheckState.Checked;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -