Beispiel #1
0
        private void buttonData_Click(object sender, EventArgs e)
        {
            string newName = DlgSelectName.GetNewName(this, "Name for the new named data", getAllDataNames(), true);

            if (!string.IsNullOrEmpty(newName))
            {
                WebDataTableSingleRow tbl = new WebDataTableSingleRow(_dataset);
                tbl.TableName = newName;
                TreeNodeNamedData tnt = new TreeNodeNamedData(tbl);
                treeViewDataSet.Nodes[0].Nodes.Add(tnt);
                _changed = true;
                treeViewDataSet.Nodes[0].Expand();
                treeViewDataSet.SelectedNode = tnt;
            }
        }
Beispiel #2
0
        private void mi_renameData(object sender, EventArgs e)
        {
            MenuItem mi = sender as MenuItem;

            if (mi != null)
            {
                TreeNodeData tnd = mi.Tag as TreeNodeData;
                if (tnd != null)
                {
                    string newName = DlgSelectName.GetNewName(this, string.Format(CultureInfo.CurrentUICulture, "Rename for data [{0}]", tnd.TableName), getAllDataNames(), true);
                    if (!string.IsNullOrEmpty(newName))
                    {
                        tnd.Table.TableName = newName;
                        tnd.Text            = newName;
                    }
                }
            }
        }