Exemplo n.º 1
0
 private void b_show_Click(object sender, EventArgs e)
 {
     createMode = false;
     p_view.Controls.Clear();
     structureIndex = 1;
     structureDepth = 1;
     tb_desc.Text = "";
     p_view.Show();
     p_create.Hide();
     p_newprotocol.Hide();
     p_newlayers.Hide();
     p_add_new_data.Hide();
     tb_desc.Show();
     l_notes.Show();
     if (cb_protocolsList.Items.Contains(cb_protocolsList.Text))
     {
         String filepath = PROTOCOLS_FILE_PATH + "\\" + cb_protocolsList.Text + ".xml";
         protocol = Facade.getProtocolFromXML(filepath);
         link_source.Text = "Source";
         LinkedList<Data> protocolData = protocol.getData();
         drawData(protocolData);
         l_protocolName.Text = cb_protocolsList.Text;
         l_protocolDesc.Text = protocol.getDescription();
     }
     else
     {
         resetView();
     }
 }
Exemplo n.º 2
0
        private void b_save_Click(object sender, EventArgs e)
        {
            protocol = new Protocol(tb_title.Text, tb_source.Text, tb_description.Text);

            tv = new TreeView();
            tv.Size = p_newlayers.Size;
            tv.Location = p_newlayers.Location;
            tv.HideSelection = false;
            tv.Nodes.Add("block", protocol.getName(), protocol.getSource(), protocol.getDescription());
            tv.SelectedNode = tv.Nodes[0];
            tv.BackColor = SystemColors.ActiveCaption;
            tv.BorderStyle = BorderStyle.Fixed3D;
            p_newlayers.Controls.Add(tv);

            p_newprotocol.Hide();
            p_newlayers.Show();
            l_protocolName.Text = protocol.getName();
            l_protocolDesc.Text = protocol.getDescription();
            p_add_new_data.Show();
        }