Example #1
0
 public void LoadData(string dataName, WebPageDataSet data, ILimnorProject project)
 {
     _baseCaption = string.Format(CultureInfo.InvariantCulture, "{0} - [{1}]", this.Text, dataName);
     _project     = project;
     _dataset     = data;
     //
     _projectResourcesNode = _project.ResourcesXmlNode;
     updateLanguagesNodes(null);
     //
     WebDataTable[] tbls = _dataset.GetData();
     for (int i = 0; i < tbls.Length; i++)
     {
         WebDataTableSingleRow sr = tbls[i] as WebDataTableSingleRow;
         if (sr != null)
         {
             TreeNodeNamedData tnn = new TreeNodeNamedData(sr);
             treeViewDataSet.Nodes[0].Nodes.Add(tnn);
         }
         else
         {
             TreeNodeTabledData tnt = new TreeNodeTabledData(tbls[i]);
             treeViewDataSet.Nodes[0].Nodes.Add(tnt);
         }
     }
     treeViewDataSet.ExpandAll();
     if (treeViewDataSet.Nodes[0].Nodes.Count > 0)
     {
         treeViewDataSet.SelectedNode = treeViewDataSet.Nodes[0].Nodes[0];
     }
 }
Example #2
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;
            }
        }