コード例 #1
0
 public OutputEntityEditorWindow(IntentEditorWindow parent)
 {
     InitializeComponent();
     ParentWindow = parent;
     Data         = new OutputEntity();
     Data.GUID    = EditorUtils.ByteArrayToHexString(EditorUtils.GenerateNextGUID());
 }
コード例 #2
0
ファイル: EditorWindow.cs プロジェクト: aytimothy/EIChatbot
        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;
        }
コード例 #3
0
ファイル: EditorWindow.cs プロジェクト: aytimothy/EIChatbot
        private void AddIntentButton_Click(object sender, EventArgs e)
        {
            IntentEditorWindow intentEditorWindow = new IntentEditorWindow(this);

            intentEditorWindow.Show();
            IntentEditors.Add(intentEditorWindow);
            intentEditorWindow.OnCompleteEvent += OnIntentEndEdit;
        }
コード例 #4
0
 public ShapeEditorWindow(IntentEditorWindow parent, Shape existingData)
 {
     isSetup = true;
     InitializeComponent();
     ParentWindow = parent;
     Data         = existingData;
     FillValues();
     isSetup = false;
 }
コード例 #5
0
 public ShapeEditorWindow(IntentEditorWindow parent)
 {
     isSetup = true;
     InitializeComponent();
     ParentWindow = parent;
     Data         = new Shape("");
     Data.GUID    = EditorUtils.ByteArrayToHexString(EditorUtils.GenerateNextGUID());
     FillValues();
     isSetup = false;
 }
コード例 #6
0
ファイル: EditorWindow.cs プロジェクト: aytimothy/EIChatbot
        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!");
            }
        }
コード例 #7
0
 public OutputEntityEditorWindow(IntentEditorWindow parent, OutputEntity existingData)
 {
     InitializeComponent();
     ParentWindow = parent;
     Data         = existingData;
 }