Esempio n. 1
0
        public void Load(Stream fileStream)
        {
            // Limpa o conteúdo da coleção
            _bsTagList.Clear();

            //
            // XmlDocument
            //
            XmlDocument  xmlDocument      = null;
            StreamReader fileStreamReader = null;

            //
            // Load TagDatabase file
            //
            xmlDocument      = new XmlDocument();
            fileStreamReader = new StreamReader(fileStream);

            xmlDocument.Load(fileStream);
            XmlElement docRoot = xmlDocument.DocumentElement;

            foreach (XmlNode tagNode in docRoot.ChildNodes)
            {
                ITag nTag = TagManager.NewTag(tagNode.Attributes["DataType"].Value);
                nTag.ReadXml(tagNode);

                _bsTagList.Add(nTag);
            }

            fileStream.Close();
            fileStream = null;
        }
Esempio n. 2
0
 private void TsbNewClick(object sender, EventArgs e)
 {
     using (SelectNewTag frmNewTag = new SelectNewTag())
     {
         if (frmNewTag.ShowDialog() == DialogResult.OK)
         {
             ITag nTag = TagManager.NewTag(frmNewTag.listBox1.SelectedItem.ToString());
             if (nTag.ShowConfigurator() == DialogResult.OK)
             {
                 _tags.Add(nTag);
                 _bsTagList.ResetBindings(false);
             }
         }
     }
 }