Ejemplo n.º 1
0
        public void Load(System.Xml.XmlNode element)
        {
            this.Name = element.Attributes["Name"].Value;

            XmlNodeList nodes = element.SelectNodes("Columns");
            if (nodes.Count == 1)
            {
                foreach(XmlNode node in nodes[0].ChildNodes)
                {
                    if (node.Name == "Column")
                    {
                        Column tmpCol = new Column(node.Attributes["Name"].Value, node.Attributes["Type"].Value);
                        tmpCol.Load(node);
                        Columns.Add(tmpCol);
                    }
                }
            }

            /*while (txR.Read())
            {
                switch (txR.Name)
                {
                    case "Columns":
                        {
                            // Load columns
                            XmlTextReader columnReader = txR.ReadSubtree();
                            while(columnReader.Read())
                            {
                                if (columnReader.Name == "Column")
                                {
                                    Column tmpCol = new Column(columnReader.GetAttribute("Name"), columnReader.GetAttribute("Type"));
                                    tmpCol.Load(columnReader.ReadSubtree());
                                    Columns.Add(tmpCol);
                                }
                            }
                            break;
                        }
                }
            }*/

               /*Name = txR.GetAttribute(0);
            while (txR.Name != "Columns")
            {
                txR.Read();
            }
            txR.Read();

            while(txR.Name != "Columns")
            {
                if(txR.Name == "Column")
                {
                    Column tmpCol = new Column();
                    tmpCol.Load(txR);
                    Columns.Add(tmpCol);
                }
                txR.Read();
            }
            txR.Read();
            txR.Read();*/
        }
Ejemplo n.º 2
0
 private void Add_Column(string dataStreamParent, string name)
 {
     foreach(DataStream tmpParent in tempDataStreams)
     {
         if(tmpParent.Name == dataStreamParent)
         {
             Column tmpColumn = new Column();
             tmpColumn.Name = name;
             tmpParent.Columns.Add(tmpColumn);
             RefreshTreeItems(tmpParent.Name);
             return;
         }
     }
 }
Ejemplo n.º 3
0
 private void UpdateToTempData()
 {
     foreach (DataStream tmpData in EditorController.Instance.EditorProject.DataStreams)
     {
         DataStream tmpDataStream = new DataStream();
         tmpDataStream.Name = tmpData.Name;
         foreach(Column tmpColumn in tmpData.Columns)
         {
             Column tmpColumnData = new Column();
             tmpColumnData.Name = tmpColumn.Name;
             tmpDataStream.Columns.Add(tmpColumnData);
         }
         tempDataStreams.Add(tmpDataStream);
     }
 }
Ejemplo n.º 4
0
        private void UpdateFromTempData()
        {
            EditorController.Instance.EditorProject.DataStreams.Clear();
            foreach(DataStream tmpData in tempDataStreams)
            {
                DataStream tmpDataStream = new DataStream();
                tmpDataStream.Name = tmpData.Name;
                foreach(Column tmpColumn in tmpData.Columns)
                {
                    Column tmpColumnData = new Column();
                    tmpColumnData.Name = tmpColumn.Name;
                    tmpDataStream.Columns.Add(tmpColumnData);
                }
                EditorController.Instance.EditorProject.DataStreams.Add(tmpDataStream);
            }

            foreach(renamedItems renItem in tempRenamed)
            {
                foreach(EditorItem item in EditorController.Instance.EditorProject.Children)
                {
                    RenameDataAndColumn(item, renItem);
                }
            }
        }