Ejemplo n.º 1
0
        private void b_add_Click(object sender, EventArgs e)
        {
            CorrectPath(cb_objpath, ".obj");
            Object.Object obj = null;
            try
            {
                obj = new Object.Object("obj\\" + cb_objpath.Text);
            }
            catch
            {
                //Console.Beep(5000, 300);
            }

            if (obj != null)
            {
                ProcessWord(cb_objpath);
                if (tb_name.Text != "" && space.Objects.Find(someObj => (someObj.Name == tb_name.Text)) == null)
                {
                    obj.Name = tb_name.Text;
                    space.Objects.Add(obj);
                    cb_object.Items.Add(tb_name.Text);
                    cb_object.SelectedItem = tb_name.Text;
                    mainCamera.Redraw();
                }
            }
            else if (cb_objpath.Items.Count > 0)
            {
                cb_objpath.Items.Remove(cb_objpath.Text);
            }
            UpdateEnability();
        }
Ejemplo n.º 2
0
 private void b_operate_Click(object sender, EventArgs e)
 {
     //if (cb_object.SelectedItem != null)
     //{
     Object.Object obj = space.Objects.Find(someObj => someObj.Name == cb_object.SelectedItem.ToString());
     //if (obj != null)
     //{
     Object.ObjectSettingsForm OSF = ObjSetForms.Find(objForm => (objForm.Object.Name == obj.Name));
     if (OSF != null)
     {
         OSF.Focus();
     }
     else
     {
         OSF = new Object.ObjectSettingsForm(space, obj);
         OSF.Show();
         OSF.Changed += OSF_Changed;
         OSF.PropertiesWasChanged += OSF_PropertiesWasChanged;
         OSF.FormClosed           += OSF_FormClosed;
         ObjSetForms.Add(OSF);
     }
     //}
     //}
 }