Ejemplo n.º 1
0
 public void DeleteRADElement()
 {
     if (currentFocusedElement != null)
     {
         Controls.Remove(currentFocusedElement.Control);
         RADElements.Remove(currentFocusedElement);
         currentFocusedElement = null;
         PropertiesForm.SetProperties(null);
     }
 }
Ejemplo n.º 2
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            CenterToScreen();

            PropertiesForm = new PropertiesForm(this);
            PropertiesForm.Show();
            PropertiesForm.SetDesktopLocation(Location.X + Width, Location.Y);


            ToolboxForm = new ToolboxForm(this);
            ToolboxForm.Show();
            ToolboxForm.SetDesktopLocation(Location.X - ToolboxForm.Width, Location.Y);
        }
Ejemplo n.º 3
0
        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                Controls.Clear();
                Controls.Add(menuStrip);
                RADElements.Clear();
                PropertiesForm.SetProperties(null);
                currentSelectedElement = null;

                ProjectSerializer projectSerializer = JsonConvert.DeserializeObject <ProjectSerializer>(File.ReadAllText(openFileDialog.FileName));

                foreach (RADElementSerializer serializer in projectSerializer.radElements)
                {
                    IRADElement element = GetElement(serializer.radType);
                    Controls.Add(element.Control);
                    RADElements.Add(element);
                    element.Deserialize(serializer.jsonValue);

                    element.SetOnClickEvent(OnClickRADElement);
                }
            }
        }
Ejemplo n.º 4
0
 private void OnClickRADElement(IRADElement radElement)
 {
     currentFocusedElement = radElement;
     PropertiesForm.SetProperties(radElement.Properties);
 }