Exemplo n.º 1
0
        //下一步
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            if (textEdit1.Text.Trim() == "")
            {
                MessageBox.Show("请输入建立的拓扑名称!", "提示");
                return;
            }
            if (checkedListBoxControl1.CheckedItems.Count == 0)
            {
                MessageBox.Show("请选择建立拓扑的要素类!", "提示");
                return;
            }
            //将选择的要素类和拓扑名添加到Topo全局变量中
            GlobalTopoVaribate.GTopoName = textEdit1.Text;
            GlobalTopoVaribate.GTopoFeatureClassList.Clear();
            for (int i = 0; i < checkedListBoxControl1.CheckedItems.Count; i++)
            {
                for (int j = 0; j < pAllFeatureClassList.Count; j++)
                {
                    if (pAllFeatureClassList[j].AliasName == checkedListBoxControl1.CheckedItems[i].ToString())
                    {
                        GlobalTopoVaribate.GTopoFeatureClassList.Add(pAllFeatureClassList[j]);
                    }
                }
            }

            GlobalTopoVaribate.GFrmLocation = this.Location;
            //实例化下一窗体
            FrmTopo3 frmTopo3 = new FrmTopo3();

            frmTopo3.Location = GlobalTopoVaribate.GFrmLocation;
            this.Hide();
            frmTopo3.Show();
        }
        /// <summary>
        /// 初始化所有静态变量的方法
        /// </summary>
        public static void ClearAllVaribate()
        {
            //删除窗体
            GFrmTopo1 = null;
            GFrmTopo2 = null;
            GFrmTopo3 = null;
            GFrmTopo4 = null;

            //删除各静态变量
            GDBPath               = null;
            GFeatureDSList        = new List <IFeatureDataset>();
            GFeatureDS            = null;
            GAllFeatureClassList  = new List <IFeatureClass>();
            GTopoFeatureClassList = new List <IFeatureClass>();
            GTopoName             = null;
            List <string> GRuleRow = new List <string>();
            DataTable     GRuleDT  = new DataTable();
        }