コード例 #1
0
        public void OnReadFromXmlNode(IXmlCodeReader serializer, XmlNode node)
        {
            XmlNode dataNode = node.SelectSingleNode(XmlTags.XML_Data);

            if (dataNode != null)
            {
                _data = new WebPageDataSet();
                _data.ReadFromXmlNode(serializer, dataNode);
                //
                WebDataTable[] tbls = _data.GetData();
                if (tbls != null)
                {
                    for (int i = 0; i < tbls.Length; i++)
                    {
                        DataTable dt = new DataTable(tbls[i].TableName);
                        Tables.Add(dt);
                        if (tbls[i].Columns != null)
                        {
                            for (int j = 0; j < tbls[i].Columns.Length; j++)
                            {
                                dt.Columns.Add(tbls[i].Columns[j].ColumnName, tbls[i].Columns[j].SystemType);
                            }
                        }
                    }
                }
            }
        }
コード例 #2
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];
     }
 }