Example #1
0
        public void Output_OnEndEdit(object sender, OnOutputEntityEndEdit e)
        {
            OutputEntityEditorWindow _sender = (OutputEntityEditorWindow)sender;

            Editors2.Remove(_sender);

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

            modified = true;
            bool exists = false;

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

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

            UpdateFields();
        }
Example #2
0
        private void OutputEntityEditorWindow_FormClosed(object sender, FormClosedEventArgs e)
        {
            OnOutputEntityEndEdit result = new OnOutputEntityEndEdit()
            {
                Data         = Data,
                DialogResult = (modified) ? DialogResult.OK : DialogResult.Cancel
            };

            OnEndEdit.Invoke(this, result);
        }