Exemplo n.º 1
0
 private void loadComponentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.openFileDialog1.ShowDialog() != DialogResult.OK)
     {
         return;
     }
     this.ch = new checker();
     this.eraseWidgets();
     this.showWidgets();
     this.setComponentName(this.openFileDialog1.FileName);
     this.showPorts();
     this.showDataElements();
 }
Exemplo n.º 2
0
        private void showComponents(string directoryPath)
        {
            if (directoryPath == null)
            {
                return;
            }
            List <string> components = new checker().getComponents(directoryPath);

            foreach (string str in components)
            {
                this.listBox_port_component.Items.Add((object)str);
                this.listBox_signal_component.Items.Add((object)str);
            }
            this.label1.Text = "Total: " + (object)components.Count;
        }
Exemplo n.º 3
0
 private void showComponents(string directoryPath)
 {
     if (directoryPath == null)
         return;
     List<string> components = new checker().getComponents(directoryPath);
     foreach (string str in components)
     {
         this.listBox_port_component.Items.Add((object)str);
         this.listBox_signal_component.Items.Add((object)str);
     }
     this.label1.Text = "Total: " + (object)components.Count;
 }
Exemplo n.º 4
0
 private void loadComponentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.openFileDialog1.ShowDialog() != DialogResult.OK)
         return;
     this.ch = new checker();
     this.eraseWidgets();
     this.showWidgets();
     this.setComponentName(this.openFileDialog1.FileName);
     this.showPorts();
     this.showDataElements();
 }
Exemplo n.º 5
0
        private void loadAllData(string directory)
        {
            int lIndexOfSlash = 0, lIndexOfdot = 0;
            string sub = "";
            ch = new checker();
            List<string> r_ports = new List<string>();
            List<string> p_ports = new List<string>();
            List<string> comps = ch.getComponents(directory);
            TextWriter tw = new StreamWriter("data.xml");
            sr = new Hashtable();

            tw.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            tw.WriteLine("<root>");
            foreach (string comp in comps)
            {
                lIndexOfSlash = comp.LastIndexOf("\\");
                lIndexOfdot = comp.LastIndexOf(".");
                sub = comp.Substring(lIndexOfSlash + 1, lIndexOfdot - lIndexOfSlash - 1);

                tw.WriteLine("<component name = \"" + sub + "\">");

                p_ports = ch.p_port(comp);
                tw.WriteLine("<pr_ports>");
                foreach (string p_port in p_ports)
                {
                    tw.WriteLine("<name>" + p_port + "</name>");

                }
                r_ports = ch.r_port(comp);
                foreach (string r_port in r_ports)
                {
                    tw.WriteLine("<name>" + r_port + "</name>");
                }
                tw.WriteLine("</pr_ports>");

                tw.WriteLine("<sr_ports>");
                sr = ch.sr_port(comp);
                foreach (string sr_port in sr.Keys)
                {
                    tw.WriteLine("<name>" + sr_port + "</name>");
                }
                tw.WriteLine("</sr_ports>");

                tw.WriteLine("<data_elements>");
                foreach (string dataE in sr.Values)
                {

                    tw.WriteLine("<name>" + dataE + "</name>");
                }
                tw.WriteLine("</data_elements>");

                this.listBox_port_component.Items.Add(sub);
                this.listBox_signal_component.Items.Add(sub);
                tw.WriteLine("</component>");
            }
            tw.WriteLine("</root>");
            tw.Close();
            this.label1.Text = "Total: " + comps.Count;
            label5.Text = "Total: " + comps.Count;
        }
Exemplo n.º 6
0
        private void loadAllData(string directory)
        {
            int    lIndexOfSlash = 0, lIndexOfdot = 0;
            string sub = "";

            ch = new checker();
            List <string> r_ports = new List <string>();
            List <string> p_ports = new List <string>();
            List <string> comps   = ch.getComponents(directory);
            TextWriter    tw      = new StreamWriter("data.xml");

            sr = new Hashtable();

            tw.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            tw.WriteLine("<root>");
            foreach (string comp in comps)
            {
                lIndexOfSlash = comp.LastIndexOf("\\");
                lIndexOfdot   = comp.LastIndexOf(".");
                sub           = comp.Substring(lIndexOfSlash + 1, lIndexOfdot - lIndexOfSlash - 1);

                tw.WriteLine("<component name = \"" + sub + "\">");

                p_ports = ch.p_port(comp);
                tw.WriteLine("<pr_ports>");
                foreach (string p_port in p_ports)
                {
                    tw.WriteLine("<name>" + p_port + "</name>");
                }
                r_ports = ch.r_port(comp);
                foreach (string r_port in r_ports)
                {
                    tw.WriteLine("<name>" + r_port + "</name>");
                }
                tw.WriteLine("</pr_ports>");

                tw.WriteLine("<sr_ports>");
                sr = ch.sr_port(comp);
                foreach (string sr_port in sr.Keys)
                {
                    tw.WriteLine("<name>" + sr_port + "</name>");
                }
                tw.WriteLine("</sr_ports>");


                tw.WriteLine("<data_elements>");
                foreach (string dataE in sr.Values)
                {
                    tw.WriteLine("<name>" + dataE + "</name>");
                }
                tw.WriteLine("</data_elements>");


                this.listBox_port_component.Items.Add(sub);
                this.listBox_signal_component.Items.Add(sub);
                tw.WriteLine("</component>");
            }
            tw.WriteLine("</root>");
            tw.Close();
            this.label1.Text = "Total: " + comps.Count;
            label5.Text      = "Total: " + comps.Count;
        }