CloseTable

2015-06-10 15:06:29  访问(1947) 赞(0) 踩(0)

private void menuItemFileCloseTables_Click(object sender, System.EventArgs e)
		{
			SelectTablesDlg dlg = new SelectTablesDlg(Session.Current.Catalog.EnumerateTables());
			dlg.Text = "Close Tables";
			if (dlg.ShowDialog() == DialogResult.OK && dlg.SelectedTables != null)
			{
				foreach(Table t in dlg.SelectedTables)
				{
					t.Close();
				}
				mapControl1.Map.Invalidate();
			}
			dlg.Dispose();
		}

/// <summary>
		/// Creates a new SelectTablesDlg object using a list of tables as input.
		/// </summary>
		/// <remarks>None.</remarks>
		/// <param name="tables">List of open tables.</param>
		public SelectTablesDlg(ITableEnumerator tables) {
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			// Populate the table list
			// Add tables to the listbox
			foreach(Table tab in tables) {
				listBoxTables.Items.Add(tab);
			}
			// Set initial selection (first item in list)
			if (listBoxTables.Items.Count > 0) 
			{
				listBoxTables.SelectedIndex = 0;
			}
		}


标签:CloseTable 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)