Exemplo n.º 1
0
        private void схемуToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SeSchema newSchema = new SeSchema();

            newSchema.ClassToTreeView(treeView.Nodes);
            UpdateComboBox();
        }
Exemplo n.º 2
0
        private void открытьСхемыФТСToolStripMenuItem_Click(object sender, EventArgs e)
        {
            treeView.SelectedNode = null;
            DirectoryInfo   diXsd = new DirectoryInfo(Path.Combine(Application.StartupPath, @"..\..\Resources\xsd\фтс2\"));
            XmlSchemaSet    xss   = ReadXSD(diXsd);
            SeSchema        seSchema;
            List <SeSchema> seSchemaList = null;

            this.Cursor = Cursors.WaitCursor;

            treeView.BeginUpdate();

            foreach (XmlSchema schema in xss.Schemas())
            {
                seSchema     = new SeSchema(schema);
                seSchemaList = seSchemaList ?? new List <SeSchema>();
                seSchemaList.Add(seSchema);
                seSchema.ClassToTreeView(treeView.Nodes);
            }
            treeView.EndUpdate();
            this.Cursor = Cursors.Default;
            ComboBoxBind(seSchemaList);
            BtnToTV.Enabled        = true;
            button_Refresh.Enabled = true;
            Button_Remove.Enabled  = true;
        }
Exemplo n.º 3
0
        private void схемуToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (openFD_XSD.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }
            // получаем выбранный файл
            string        filePath = openFD_XSD.FileName;
            string        filename = openFD_XSD.SafeFileName;
            DirectoryInfo diXsd    = new DirectoryInfo(filePath);

            XmlSchemaSet           xss     = null;
            XmlSchema              xs      = null;
            XmlSchemas             schemas = null;
            ValidationEventHandler ValidationErrorHandler = null;

            treeView.Nodes.Clear();
            xss = new XmlSchemaSet();
            xss.ValidationEventHandler += ValidationErrorHandler;
            xss.XmlResolver             = new XmlUrlResolver();
            schemas = new XmlSchemas();
            try
            {
                using (var sr = new StreamReader(diXsd.FullName))
                {
                    xs = XmlSchema.Read(sr, ValidationErrorHandler);
                    xss.Add(xs);
                    schemas.Add(xs);
                }
                // MessageBox.Show("Schema " + fi.Name + " read successfully ");


                xss.Compile();
            }
            catch (Exception e1)
            {
                MessageBox.Show(e.ToString());
            }

            SeSchema        seSchema;
            List <SeSchema> seSchemaList = null;

            //treeView1.BeginUpdate();
            foreach (XmlSchema schema in xss.Schemas())
            {
                seSchema     = new SeSchema(schema);
                seSchemaList = seSchemaList ?? new List <SeSchema>();
                seSchemaList.Add(seSchema);
                seSchema.ClassToTreeView(treeView.Nodes);
            }
            //treeView1.EndUpdate();
            ComboBoxBind(seSchemaList);
            BtnToTV.Enabled        = true;
            button_Refresh.Enabled = true;
            Button_Remove.Enabled  = true;
        }
Exemplo n.º 4
0
 public void UpdateTreeView(TreeNodeCollection tnc)
 {
     //treeView1.BeginUpdate();
     treeView.Nodes.Clear();
     for (int i = 0; i < comboBox_SchemaList.Items.Count; i++)
     {
         SeSchema seSchema = (SeSchema)comboBox_SchemaList.Items[i];
         seSchema.ClassToTreeView(treeView.Nodes);
     }
     //treeView1.EndUpdate();
 }
Exemplo n.º 5
0
        private void Button_AddSchema_Click(object sender, EventArgs e)
        {
            SeSchema newSchema = new SeSchema();

            newSchema.ClassToTreeView(treeView.Nodes);
            UpdateComboBox();

            BtnToTV.Enabled        = true;
            button_Refresh.Enabled = true;
            Button_Remove.Enabled  = true;
        }
Exemplo n.º 6
0
        private void BtnToTV_Click(object sender, EventArgs e)
        {
            SeSchema seSchema = (SeSchema)comboBox_SchemaList.SelectedItem;

            treeView.Nodes.Clear();

            if (seSchema != null)
            {
                seSchema.ClassToTreeView(treeView.Nodes);
            }
        }