Ejemplo n.º 1
0
 private void listThemen_DragDrop(object sender, DragEventArgs e)
 {
   if (this.DateiIstReadOnly)
     return;
   if (e.Data.GetDataPresent(typeof (AIMLCategory)))
   {
     AIMLCategory data = (AIMLCategory) e.Data.GetData(typeof (AIMLCategory));
     if (data == null)
       return;
     AIMLTopic aimlTopic = this.TopicUnterPos(new Point(e.X, e.Y));
     if (aimlTopic != null)
     {
       if (aimlTopic != data.AIMLTopic)
       {
         aimlTopic.AddNewCategory().ContentNode.InnerXml = data.ContentNode.InnerXml;
         e.Effect = DragDropEffects.Move;
       }
       else
         e.Effect = DragDropEffects.None;
     }
     else
       e.Effect = DragDropEffects.None;
   }
   else
     e.Effect = DragDropEffects.None;
 }
Ejemplo n.º 2
0
        private void dataGridViewCategories_MouseMove(object sender, MouseEventArgs e)
        {
            if (this.DateiIstReadOnly || e.Button != MouseButtons.Left || this.AktuelleCategory == null)
            {
                return;
            }
            AIMLCategory aktuelleCategory = this.AktuelleCategory;

            if (this.dataGridViewCategories.DoDragDrop((object)aktuelleCategory, DragDropEffects.Copy | DragDropEffects.Move) == DragDropEffects.Move && aktuelleCategory != null)
            {
                AIMLTopic    aimlTopic        = aktuelleCategory.AIMLTopic;
                AIMLCategory liegendeCategory = this.GetNaechstLiegendeCategory(aktuelleCategory);
                aimlTopic.LoescheCategory(aktuelleCategory);
                this.AIMLCategoriesNeuAnzeigen(false);
                if (liegendeCategory != null)
                {
                    this.AktuelleCategory = liegendeCategory;
                }
                else
                {
                    this._arbeitsbereich.Fokus.BesteCategorySelektieren();
                }
                this.ZeilenInhalteRefreshen();
            }
        }
Ejemplo n.º 3
0
 protected virtual void AktAIMLCategoryChangedEvent(AIMLCategory category)
 {
     if (this.AktAIMLCategoryChanged != null)
     {
         this.AktAIMLCategoryChanged(this, new EventArgs <AIMLCategory>(category));
     }
 }
Ejemplo n.º 4
0
        private void AktuelleCategoryLoeschen()
        {
            AIMLCategory aktuelleCategory = this.AktuelleCategory;

            if (aktuelleCategory == null || MessageBox.Show(ResReader.Reader.GetString("AktuelleCategoryWirklichLoeschen"), ResReader.Reader.GetString(nameof(AktuelleCategoryLoeschen)), MessageBoxButtons.YesNoCancel) != DialogResult.Yes)
            {
                return;
            }
            AIMLCategory liegendeCategory = this.GetNaechstLiegendeCategory(aktuelleCategory);

            if (this.aimlTopic == null)
            {
                throw new ApplicationException("aimlTopic==null!");
            }
            if (aktuelleCategory == null)
            {
                throw new ApplicationException("Es ist keine aktuelle Category mehr zum Löschen gewählt!");
            }
            this.aimlTopic.LoescheCategory(aktuelleCategory);
            if (liegendeCategory != null)
            {
                this.AktuelleCategory = liegendeCategory;
            }
            else
            {
                if (this._arbeitsbereich == null)
                {
                    throw new ApplicationException("_arbeitsbereich==null!");
                }
                this._arbeitsbereich.Fokus.BesteCategorySelektieren();
            }
        }
Ejemplo n.º 5
0
 private void listThemen_DragOver(object sender, DragEventArgs e)
 {
   if (this.DateiIstReadOnly)
     return;
   if (e.Data.GetDataPresent(typeof (AIMLCategory)))
   {
     AIMLCategory data = (AIMLCategory) e.Data.GetData(typeof (AIMLCategory));
     if (data != null)
     {
       AIMLTopic aimlTopic = this.TopicUnterPos(new Point(e.X, e.Y));
       if (aimlTopic != null)
       {
         if (aimlTopic != data.AIMLTopic)
           e.Effect = DragDropEffects.Move;
         else
           e.Effect = DragDropEffects.None;
       }
       else
         e.Effect = DragDropEffects.None;
     }
     else
       e.Effect = DragDropEffects.None;
   }
   else
     e.Effect = DragDropEffects.None;
 }
Ejemplo n.º 6
0
 public bool IstSraiNachfolger(AIMLCategory potentiellerVorgaenger)
 {
     if (potentiellerVorgaenger == this)
     {
         return(false);
     }
     if (potentiellerVorgaenger.AIMLTopic.Name == this.AIMLTopic.Name)
     {
         if (potentiellerVorgaenger.Srais.Length == 0)
         {
             return(false);
         }
         foreach (Regex item in potentiellerVorgaenger.SraisRegExOptimiertFuerVerwandte)
         {
             if (item.IsMatch(this.Pattern))
             {
                 return(true);
             }
         }
         string[] sraisOptimiertFuerVerwandte = potentiellerVorgaenger.SraisOptimiertFuerVerwandte;
         foreach (string input in sraisOptimiertFuerVerwandte)
         {
             if (!AIMLCategory.RegExNurStars.IsMatch(this.Pattern) && this.PatternRegExOptimiertFuerVerwandte.IsMatch(input))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Ejemplo n.º 7
0
        public AIMLCategory AddNewCategory(XmlNode newCategoryNode)
        {
            AIMLCategory newCategory = AIMLCategory.createNewCategory(this, newCategoryNode);

            this.Categories.Add(newCategory);
            return(newCategory);
        }
Ejemplo n.º 8
0
        public AIMLCategory AddNewCategory()
        {
            AIMLCategory newCategory = AIMLCategory.createNewCategory(this);

            this.Categories.Add(newCategory);
            return(newCategory);
        }
        private void NeueCategoryHinzufuegen()
        {
            AIMLCategory aIMLCategory2 = this.AktuelleCategory = this.aimlTopic.AddNewCategory();

            this._arbeitsbereich.Fokus.FokusAufXmlEditorSetzen();
            this.AIMLCategoriesNeuAnzeigen(true);
        }
 private void listThemen_DragDrop(object sender, DragEventArgs e)
 {
     if (!this.DateiIstReadOnly)
     {
         if (e.Data.GetDataPresent(typeof(AIMLCategory)))
         {
             AIMLCategory aIMLCategory = (AIMLCategory)e.Data.GetData(typeof(AIMLCategory));
             if (aIMLCategory != null)
             {
                 AIMLTopic aIMLTopic = this.TopicUnterPos(new Point(e.X, e.Y));
                 if (aIMLTopic != null)
                 {
                     if (aIMLTopic != aIMLCategory.AIMLTopic)
                     {
                         AIMLCategory aIMLCategory2 = aIMLTopic.AddNewCategory();
                         aIMLCategory2.ContentNode.InnerXml = aIMLCategory.ContentNode.InnerXml;
                         e.Effect = DragDropEffects.Move;
                     }
                     else
                     {
                         e.Effect = DragDropEffects.None;
                     }
                 }
                 else
                 {
                     e.Effect = DragDropEffects.None;
                 }
             }
         }
         else
         {
             e.Effect = DragDropEffects.None;
         }
     }
 }
Ejemplo n.º 11
0
 protected virtual void AktAIMLCategoryChangedEvent(AIMLCategory category)
 {
     if (this.AktAIMLCategoryChanged == null)
     {
         return;
     }
     this.AktAIMLCategoryChanged((object)this, new EventArgs <AIMLCategory>(category));
 }
Ejemplo n.º 12
0
        private void cloneToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AIMLCategory aktuelleCategory = this.AktuelleCategory;
            XmlNode      newCategoryNode  = aktuelleCategory.ContentNode.Clone();

            this.AktuelleCategory = aktuelleCategory.AIMLTopic.AddNewCategory(newCategoryNode);
            this._arbeitsbereich.Fokus.FokusAufXmlEditorSetzen();
            this.AIMLCategoriesNeuAnzeigen(true);
        }
Ejemplo n.º 13
0
 public void LoescheCategory(AIMLCategory category)
 {
     if (category == null)
     {
         return;
     }
     if (this.Categories == null)
     {
         Debugger.GlobalDebugger.FehlerZeigen("Categories == null", (object)this, "GaitoBotEditorCore.AIMLTopic.LoescheCategory");
     }
     else
     {
         if (this.Categories.Contains(category))
         {
             this.Categories.Remove(category);
         }
         if (this._aimlDatei == null)
         {
             Debugger.GlobalDebugger.FehlerZeigen("_aimlDatei == null", (object)this, "GaitoBotEditorCore.AIMLTopic.LoescheCategory");
         }
         else if (this._aimlDatei.Arbeitsbereich == null)
         {
             Debugger.GlobalDebugger.FehlerZeigen("_aimlDatei.Arbeitsbereich == null", (object)this, "GaitoBotEditorCore.AIMLTopic.LoescheCategory");
         }
         else if (this._aimlDatei.Arbeitsbereich.Verlauf == null)
         {
             Debugger.GlobalDebugger.FehlerZeigen("_aimlDatei.Arbeitsbereich.Verlauf == null", (object)this, "GaitoBotEditorCore.AIMLTopic.LoescheCategory");
         }
         else
         {
             this._aimlDatei.Arbeitsbereich.Verlauf.AlleVerweiseDieserAIMLCategoryEntfernen(category);
             if (category == null)
             {
                 throw new ApplicationException("category wurde offenbar nachträglich noch == null");
             }
             try
             {
                 category.Delete();
             }
             catch (Exception ex)
             {
                 throw new ApplicationException("Fehler bei  category.Delete():" + ex.Message);
             }
             try
             {
                 category.Dispose();
             }
             catch (Exception ex)
             {
                 throw new ApplicationException("Fehler bei  category.Dispose():" + ex.Message);
             }
         }
     }
 }
Ejemplo n.º 14
0
 public bool IstDuplikat(AIMLCategory potentiellesDuplikat)
 {
     if (potentiellesDuplikat == this)
     {
         return(false);
     }
     if (potentiellesDuplikat.AIMLTopic.Name == this.AIMLTopic.Name && potentiellesDuplikat.Pattern == this.Pattern && potentiellesDuplikat.That == this.That)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 15
0
 private void AIMLCategoryDurchsuchen(AIMLCategory category, string suchEingabe)
 {
     try
     {
         if (category.ContentNode.InnerXml.IndexOf(suchEingabe, StringComparison.OrdinalIgnoreCase) != -1)
         {
             this._treffer.Add(category);
         }
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 16
0
        private void AIMLCategoriesNeuAnzeigen(
            bool markierteZeileAufJedenFallInDenSichtbarenBereichScrollen)
        {
            if (this._wirdGeradeNeuGezeichnet)
            {
                return;
            }
            this._wirdGeradeNeuGezeichnet = true;
            int       num       = 0;
            AIMLTopic aimlTopic = this.aimlTopic;

            if (aimlTopic == null)
            {
                num = 0;
                this._merkeCategories = (List <AIMLCategory>)null;
                this.Enabled          = false;
                this.dataGridViewCategories.Rows.Clear();
            }
            else
            {
                this._merkeCategories = aimlTopic.Categories;
                this.AnzahlZeilenAuffuellen(this._merkeCategories.Count);
                AIMLCategory aktuelleCategory = this.AktuelleCategory;
                if (aktuelleCategory != null)
                {
                    int index = this._merkeCategories.IndexOf(aktuelleCategory);
                    if (index != -1)
                    {
                        DataGridViewRow row = this.dataGridViewCategories.Rows[index];
                        if (!row.Selected)
                        {
                            row.Selected = true;
                        }
                        if (!row.Displayed | markierteZeileAufJedenFallInDenSichtbarenBereichScrollen)
                        {
                            try
                            {
                                this.dataGridViewCategories.FirstDisplayedScrollingRowIndex = index;
                            }
                            catch (Exception ex)
                            {
                            }
                        }
                    }
                }
                this.Enabled = true;
            }
            this._wirdGeradeNeuGezeichnet = false;
            this.ToolStripButtonsAnzeigen();
            this.ZeilenInhalteRefreshen();
        }
Ejemplo n.º 17
0
 public WorkflowElementCategory(string kontext, AIMLCategory category, int breite, int hoehe)
 {
     this._category = category;
     this._breite   = breite;
     this._hoehe    = hoehe;
     this._kontext  = kontext;
     if (WorkflowElementCategory._drawFontNodeName == null)
     {
         WorkflowElementCategory._drawFontNodeName       = new Font("Arial", 10f, GraphicsUnit.Pixel);
         WorkflowElementCategory._drawFormat             = (StringFormat)StringFormat.GenericTypographic.Clone();
         WorkflowElementCategory._drawFormat.FormatFlags = (WorkflowElementCategory._drawFormat.FormatFlags | StringFormatFlags.MeasureTrailingSpaces);
         WorkflowElementCategory._drawFormat.Trimming    = StringTrimming.None;
     }
 }
 private void toolStripButtonSortieren_Click(object sender, EventArgs e)
 {
     if (this._arbeitsbereich != null)
     {
         AIMLTopic aktAIMLTopic = this._arbeitsbereich.Fokus.AktAIMLTopic;
         if (aktAIMLTopic != null)
         {
             aktAIMLTopic.CategoriesSortieren_();
             this.AIMLCategoriesNeuAnzeigen(true);
             AIMLCategory aktuelleCategory = this.AktuelleCategory;
             this.AktuelleCategory = null;
             this.AktuelleCategory = aktuelleCategory;
         }
     }
 }
Ejemplo n.º 19
0
 private void dataGridViewTrefferliste_SelectionChanged(object sender, EventArgs e)
 {
     if (this._treffer != null && this._treffer.Count != 0 && this.dataGridViewTrefferliste.SelectedRows.Count == 1)
     {
         int index = this.dataGridViewTrefferliste.SelectedRows[0].Index;
         if (index <= this._treffer.Count - 1)
         {
             if (this._treffer[index] is AIMLCategory)
             {
                 AIMLCategory aktAIMLCategory = (AIMLCategory)this._treffer[index];
                 this._arbeitsbereich.Fokus.AktAIMLCategory = aktAIMLCategory;
             }
             Application.DoEvents();
         }
     }
 }
 public void Vorwaerts()
 {
     if (this._nachher.Count >= 2)
     {
         this._eigeneNavigationLaeuft = true;
         AIMLCategory item = this._nachher[this._nachher.Count - 1];
         this._nachher.RemoveAt(this._nachher.Count - 1);
         this._vorher.Add(item);
         if (this._nachher.Count > 0)
         {
             this._fokus.AktAIMLCategory = this._nachher[this._nachher.Count - 1];
             this._vorher.Add(this._nachher[this._nachher.Count - 1]);
         }
         this._eigeneNavigationLaeuft = false;
         this.ChangedEvent();
     }
 }
Ejemplo n.º 21
0
        public void Zurueck()
        {
            if (this._vorher.Count < 2)
            {
                return;
            }
            this._eigeneNavigationLaeuft = true;
            AIMLCategory aimlCategory = this._vorher[this._vorher.Count - 1];

            this._vorher.RemoveAt(this._vorher.Count - 1);
            this._nachher.Add(aimlCategory);
            if (this._vorher.Count > 0)
            {
                this._fokus.AktAIMLCategory = this._vorher[this._vorher.Count - 1];
                this._nachher.Add(this._vorher[this._vorher.Count - 1]);
            }
            this._eigeneNavigationLaeuft = false;
            this.ChangedEvent();
        }
        public void AlleVerweiseDieserAIMLCategoryEntfernen(AIMLCategory category)
        {
            bool flag = false;

            if (this._vorher.Contains(category))
            {
                this._vorher.Remove(category);
                flag = true;
            }
            if (this._nachher.Contains(category))
            {
                this._nachher.Remove(category);
                flag = true;
            }
            if (flag)
            {
                this.ChangedEvent();
            }
        }
Ejemplo n.º 23
0
 private AIMLCategory GetNaechstLiegendeCategory(AIMLCategory category)
 {
     if (category.ContentNode.NextSibling != null)
     {
         AIMLCategory categoryForCategoryNode = this._arbeitsbereich.GetCategoryForCategoryNode(category.ContentNode.NextSibling);
         if (categoryForCategoryNode != null)
         {
             return(categoryForCategoryNode);
         }
     }
     else if (category.ContentNode.PreviousSibling != null)
     {
         AIMLCategory categoryForCategoryNode = this._arbeitsbereich.GetCategoryForCategoryNode(category.ContentNode.PreviousSibling);
         if (categoryForCategoryNode != null)
         {
             return(categoryForCategoryNode);
         }
     }
     return((AIMLCategory)null);
 }
        private void toolStripButtonTHATKlonen_Click_1(object sender, EventArgs e)
        {
            AIMLCategory aktuelleCategory = this.AktuelleCategory;
            AIMLCategory aIMLCategory     = aktuelleCategory.AIMLTopic.AddNewCategory();
            XmlNode      xmlNode          = aIMLCategory.ContentNode.OwnerDocument.CreateElement("that");
            string       text             = xmlNode.InnerXml = aktuelleCategory.That;
            XmlNode      xmlNode2         = aIMLCategory.ContentNode.SelectSingleNode("pattern");

            if (xmlNode2 != null)
            {
                aIMLCategory.ContentNode.InsertAfter(xmlNode, xmlNode2);
                this.AktuelleCategory = aIMLCategory;
                this._arbeitsbereich.Fokus.FokusAufXmlEditorSetzen();
            }
            else
            {
                aktuelleCategory.AIMLTopic.LoescheCategory(aIMLCategory);
            }
            this.AIMLCategoriesNeuAnzeigen(true);
        }
Ejemplo n.º 25
0
        private void toolStripButtonPassendesSRAI_Click_1(object sender, EventArgs e)
        {
            AIMLCategory aktuelleCategory = this.AktuelleCategory;
            AIMLCategory category         = aktuelleCategory.AIMLTopic.AddNewCategory();
            XmlNode      xmlNode          = aktuelleCategory.ContentNode.SelectSingleNode("pattern");

            if (xmlNode != null)
            {
                XmlNode element = (XmlNode)category.ContentNode.OwnerDocument.CreateElement("srai");
                element.InnerText = xmlNode.InnerXml;
                category.ContentNode.SelectSingleNode("template").AppendChild(element);
                this.AktuelleCategory = category;
                this._arbeitsbereich.Fokus.FokusAufXmlEditorSetzen();
            }
            else
            {
                aktuelleCategory.AIMLTopic.LoescheCategory(category);
            }
            this.AIMLCategoriesNeuAnzeigen(true);
        }
Ejemplo n.º 26
0
 private void ZeilenInhalteRefreshen()
 {
     if (this._treffer != null && this._treffer.Count != 0)
     {
         int firstDisplayedScrollingRowIndex = this.dataGridViewTrefferliste.FirstDisplayedScrollingRowIndex;
         int val = firstDisplayedScrollingRowIndex + this.dataGridViewTrefferliste.DisplayedRowCount(true);
         firstDisplayedScrollingRowIndex = Math.Max(0, firstDisplayedScrollingRowIndex);
         val = Math.Min(val, this._treffer.Count);
         for (int i = firstDisplayedScrollingRowIndex; i < val; i++)
         {
             if (this._treffer[i] is AIMLCategory)
             {
                 AIMLCategory aIMLCategory = (AIMLCategory)this._treffer[i];
                 this.dataGridViewTrefferliste.Rows[i].Cells[0].Value = aIMLCategory.AIMLTopic.AIMLDatei.Titel;
                 this.dataGridViewTrefferliste.Rows[i].Cells[1].Value = aIMLCategory.AIMLTopic.Name;
                 this.dataGridViewTrefferliste.Rows[i].Cells[2].Value = aIMLCategory.AutoKomplettZusammenfassung;
             }
         }
         Application.DoEvents();
     }
 }
Ejemplo n.º 27
0
 public void BesteCategorySelektieren()
 {
     if (this._aktAIMLTopic == null)
     {
         this.AktAIMLCategory = (AIMLCategory)null;
     }
     else
     {
         List <AIMLCategory> categories        = this._aktAIMLTopic.Categories;
         AIMLCategory        gewaehlteCategory = this._aktAIMLTopic.ZuletztInDiesemTopicGewaehlteCategory;
         AIMLCategory        aimlCategory      = (AIMLCategory)null;
         if (gewaehlteCategory != null && categories.Contains(gewaehlteCategory))
         {
             aimlCategory = gewaehlteCategory;
         }
         if (aimlCategory == null)
         {
             aimlCategory = categories.Count != 0 ? categories[0] : (AIMLCategory)null;
         }
         this.AktAIMLCategory = aimlCategory;
     }
 }
Ejemplo n.º 28
0
 public void BesteCategorySelektieren()
 {
     if (this._aktAIMLTopic == null)
     {
         this.AktAIMLCategory = null;
     }
     else
     {
         List <AIMLCategory> categories = this._aktAIMLTopic.Categories;
         AIMLCategory        zuletztInDiesemTopicGewaehlteCategory = this._aktAIMLTopic.ZuletztInDiesemTopicGewaehlteCategory;
         AIMLCategory        aIMLCategory = null;
         if (zuletztInDiesemTopicGewaehlteCategory != null && categories.Contains(zuletztInDiesemTopicGewaehlteCategory))
         {
             aIMLCategory = zuletztInDiesemTopicGewaehlteCategory;
         }
         if (aIMLCategory == null)
         {
             aIMLCategory = ((categories.Count != 0) ? categories[0] : null);
         }
         this.AktAIMLCategory = aIMLCategory;
     }
 }
Ejemplo n.º 29
0
        private void toolStripButtonCreateTHATReference_Click_1(object sender, EventArgs e)
        {
            AIMLCategory aktuelleCategory = this.AktuelleCategory;
            AIMLCategory category         = aktuelleCategory.AIMLTopic.AddNewCategory();
            XmlNode      element          = (XmlNode)category.ContentNode.OwnerDocument.CreateElement("that");
            string       template         = aktuelleCategory.Template;

            element.InnerXml = template;
            XmlNode refChild = category.ContentNode.SelectSingleNode("pattern");

            if (refChild != null)
            {
                category.ContentNode.InsertAfter(element, refChild);
                this.AktuelleCategory = category;
                this._arbeitsbereich.Fokus.FokusAufXmlEditorSetzen();
            }
            else
            {
                aktuelleCategory.AIMLTopic.LoescheCategory(category);
            }
            this.AIMLCategoriesNeuAnzeigen(true);
        }
Ejemplo n.º 30
0
        private void toolStripButtonCloneTemplate_Click_1(object sender, EventArgs e)
        {
            AIMLCategory aktuelleCategory = this.AktuelleCategory;
            AIMLCategory category         = aktuelleCategory.AIMLTopic.AddNewCategory();
            XmlNode      xmlNode1         = aktuelleCategory.ContentNode.SelectSingleNode("template");
            XmlNode      xmlNode2         = category.ContentNode.SelectSingleNode("template");

            if (xmlNode1 != null)
            {
                foreach (XmlNode childNode in xmlNode1.ChildNodes)
                {
                    XmlNode newChild = childNode.Clone();
                    xmlNode2.AppendChild(newChild);
                }
                this.AktuelleCategory = category;
                this._arbeitsbereich.Fokus.FokusAufXmlEditorSetzen();
            }
            else
            {
                aktuelleCategory.AIMLTopic.LoescheCategory(category);
            }
            this.AIMLCategoriesNeuAnzeigen(true);
        }