Esempio n. 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];
     }
 }
Esempio n. 2
0
 public TreeNodeNamedData(WebDataTableSingleRow table)
     : base(table)
 {
     Text               = table.TableName;
     ImageIndex         = 9;
     SelectedImageIndex = ImageIndex;
 }
Esempio n. 3
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;
            }
        }
Esempio n. 4
0
        public void ReadFromXmlNode(IXmlCodeReader reader, XmlNode node)
        {
            XmlNodeList ns = node.SelectNodes(XML_Item);

            _data = new WebDataTable[ns.Count];
            for (int i = 0; i < ns.Count; i++)
            {
                int dt = XmlUtil.GetAttributeInt(ns[i], XMLATT_dtype);
                if (dt == 1)
                {
                    _data[i] = new WebDataTableSingleRow(this);
                }
                else
                {
                    _data[i] = new WebDataTable(this);
                }
                _data[i].ReadFromXmlNode(reader, ns[i]);
            }
        }
Esempio n. 5
0
        private void showData()
        {
            CultureInfo     cultrue = null;
            WebDataTable    table   = null;
            TreeNodeCulture tnc     = treeViewLanguages.SelectedNode as TreeNodeCulture;

            if (tnc != null)
            {
                cultrue = tnc.Culture;
                TreeNodeData tnd = treeViewDataSet.SelectedNode as TreeNodeData;
                if (tnd != null)
                {
                    table = tnd.Table;
                }
            }
            _currentProperty         = null;
            dataGridView1.DataSource = null;
            dataGridView1.DataBindings.Clear();
            dataGridView1.Columns.Clear();
            if (cultrue != null && table != null)
            {
                showCulture(cultrue);
                table.CurrentCulture = cultrue.Name;
                WebDataTableSingleRow singleRow = table as WebDataTableSingleRow;
                if (singleRow != null)
                {
                    propertyGrid1.SelectedObject = singleRow;
                    propertyGrid1.Visible        = true;
                    //
                    dataGridView1.Visible = false;
                }
                else
                {
                    dataGridView1.Visible    = true;
                    propertyGrid1.Visible    = false;
                    dataGridView1.DataSource = table.CreateDataTable(cultrue.Name);
                }
            }
            else
            {
                propertyGrid1.SelectedObject = null;
            }
        }