Esempio n. 1
0
        private void Shape_OnEndEdit(object sender, OnShapeEndEdit e)
        {
            ShapeEditorWindow _sender = (ShapeEditorWindow)sender;

            Editors.Remove(_sender);

            if (e.DialogResult != DialogResult.OK)
            {
                return;
            }

            modified = true;
            bool exists = false;

            for (int i = 0; i < Data.Shapes.Length; i++)
            {
                if (Data.Shapes[i].GUID.ToUpper() == e.Data.GUID.ToUpper())
                {
                    exists         = true;
                    Data.Shapes[i] = e.Data;
                }
            }

            if (!exists)
            {
                Array.Resize <Shape>(ref Data.Shapes, Data.Shapes.Length + 1);
                Data.Shapes[Data.Shapes.Length - 1] = e.Data;
            }

            UpdateFields();
        }
Esempio n. 2
0
        private void ShapeEditorWindow_FormClosed(object sender, FormClosedEventArgs e)
        {
            List <Entity> entities = new List <Entity>();

            foreach (EntityEditorTab tab in ShapeTabs)
            {
                entities.Add(tab.Data);
            }
            Data.Entities = entities.ToArray();

            OnShapeEndEdit result = new OnShapeEndEdit()
            {
                Data         = Data,
                DialogResult = (Modified) ? DialogResult.OK : DialogResult.Cancel
            };

            OnEndEdit.Invoke(this, result);
        }