public OutputEntityEditorWindow(IntentEditorWindow parent) { InitializeComponent(); ParentWindow = parent; Data = new OutputEntity(); Data.GUID = EditorUtils.ByteArrayToHexString(EditorUtils.GenerateNextGUID()); }
private void OnIntentEndEdit(object sender, IntentEditorWindowOnEndEditEvent e) { IntentEditorWindow _sender = (IntentEditorWindow)sender; IntentEditors.Remove(_sender); bool exists = false; if (Data.Intents.Length > 0) { for (int i = 0; i < Data.Intents.Length; i++) { if (Data.Intents[i].GUID == e.Data.GUID) { exists = true; Data.Intents[i] = e.Data; } } } if (!exists) { Array.Resize <Intent>(ref Data.Intents, Data.Intents.Length + 1); Data.Intents[Data.Intents.Length - 1] = e.Data; } UpdateIntents(); modified = true; }
private void AddIntentButton_Click(object sender, EventArgs e) { IntentEditorWindow intentEditorWindow = new IntentEditorWindow(this); intentEditorWindow.Show(); IntentEditors.Add(intentEditorWindow); intentEditorWindow.OnCompleteEvent += OnIntentEndEdit; }
public ShapeEditorWindow(IntentEditorWindow parent, Shape existingData) { isSetup = true; InitializeComponent(); ParentWindow = parent; Data = existingData; FillValues(); isSetup = false; }
public ShapeEditorWindow(IntentEditorWindow parent) { isSetup = true; InitializeComponent(); ParentWindow = parent; Data = new Shape(""); Data.GUID = EditorUtils.ByteArrayToHexString(EditorUtils.GenerateNextGUID()); FillValues(); isSetup = false; }
private void EditIntentButton_Click(object sender, EventArgs e) { string guid = (string)IntentView.Rows[IntentView.CurrentCell.RowIndex].Cells[0].Value; bool found = false; foreach (Intent intent in Data.Intents) { if (intent.GUID.ToUpper() == guid.ToUpper()) { IntentEditorWindow intentEditor = new IntentEditorWindow(this, intent); intentEditor.OnCompleteEvent += OnIntentEndEdit; IntentEditors.Add(intentEditor); intentEditor.Show(); found = true; break; } } if (!found) { MessageBox.Show("Could not find intent with GUID: \"" + guid.ToUpper() + "\".", "Error!"); } }
public OutputEntityEditorWindow(IntentEditorWindow parent, OutputEntity existingData) { InitializeComponent(); ParentWindow = parent; Data = existingData; }