Esempio 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;
 }
 private void NeuesTopicHinzufuegen()
 {
     if (!this.DateiIstReadOnly)
     {
         AIMLTopic aIMLTopic2 = this.AktuellesThema = this.AimlDatei.AddNewTopic();
     }
 }
Esempio n. 3
0
        public AIMLTopic AddNewTopic()
        {
            AIMLTopic aIMLTopic = AIMLTopic.createNewTopic(this);

            this._topicListe.Add(aIMLTopic);
            return(aIMLTopic);
        }
 public void AlleVerweiseDiesesAIMLTopicEntfernen(AIMLTopic topic)
 {
     foreach (AIMLCategory category in topic.Categories)
     {
         this.AlleVerweiseDieserAIMLCategoryEntfernen(category);
     }
 }
Esempio n. 5
0
 public void AktuellesTopicUmbenennen()
 {
   AIMLTopic aktuellesThema = this.AktuellesThema;
   if (aktuellesThema == null)
     return;
   if (aktuellesThema.IstRootTopic)
   {
     int num1 = (int) MessageBox.Show(ResReader.Reader.GetString("KannStandardTopicNichtUmbenennen"), ResReader.Reader.GetString("KonnteAIMLTopicNichtUmbenennen"));
   }
   else
   {
     bool abgebrochen = false;
     bool flag = false;
     while (!flag)
     {
       string str1 = InputBox.Show(ResReader.Reader.GetString("BitteNamenFuerAIMLTopic"), ResReader.Reader.GetString("NameFuerAIMLTopicVergeben"), aktuellesThema.Name, out abgebrochen);
       if (str1 == "" || str1 == null)
         abgebrochen = true;
       if (abgebrochen)
       {
         flag = true;
       }
       else
       {
         string str2 = str1.Trim();
         if (aktuellesThema.Name == str2)
         {
           flag = true;
         }
         else
         {
           string text = (string) null;
           foreach (AIMLTopic topic in aktuellesThema.AIMLDatei.getTopics())
           {
             if (aktuellesThema != topic && topic.Name == str2)
               text = string.Format(ResReader.Reader.GetString("TopicNameSchonVorhanden"), (object) str2);
           }
           if (text == null)
           {
             try
             {
               aktuellesThema.Name = str2;
               this.AIMLTopicsNeuAnzeigen();
               flag = true;
             }
             catch (Exception ex)
             {
               text = ex.Message;
             }
           }
           if (text != null)
           {
             int num2 = (int) MessageBox.Show(text, ResReader.Reader.GetString("KonnteAIMLTopicNichtUmbenennen"));
             Debugger.GlobalDebugger.Protokolliere("Konnte AIMLTopic '" + aktuellesThema.Name + "' nicht umbenennen:" + text, Debugger.ProtokollTypen.Fehlermeldung);
           }
         }
       }
     }
   }
 }
Esempio n. 6
0
 public void BestesTopicSelektieren()
 {
     if (this._aktDatei == null)
     {
         this.AktAIMLTopic = null;
     }
     else if (!(this._aktDatei is AIMLDatei))
     {
         this.AktAIMLTopic = null;
     }
     else
     {
         AIMLDatei aIMLDatei = (AIMLDatei)this._aktDatei;
         IOrderedEnumerable <AIMLTopic> source = from t in aIMLDatei.getTopics()
                                                 orderby t.Name
                                                 select t;
         AIMLTopic zuletztInDieserDateiGewaehlesTopic = aIMLDatei.ZuletztInDieserDateiGewaehlesTopic;
         if (zuletztInDieserDateiGewaehlesTopic != null && source.Contains(zuletztInDieserDateiGewaehlesTopic))
         {
             this.AktAIMLTopic = zuletztInDieserDateiGewaehlesTopic;
         }
         else if (source.Count() == 0)
         {
             this.AktAIMLTopic = null;
         }
         else
         {
             this.AktAIMLTopic = source.First();
         }
     }
 }
 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;
         }
     }
 }
Esempio n. 8
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();
            }
        }
Esempio n. 9
0
 protected virtual void AktAIMLTopicChangedEvent(AIMLTopic topic)
 {
     if (this.AktAIMLTopicChanged != null)
     {
         this.AktAIMLTopicChanged(this, new AktAIMLTopicChangedEventArgs(topic));
     }
 }
Esempio n. 10
0
 public void BestesTopicSelektieren()
 {
     if (this._aktDatei == null)
     {
         this.AktAIMLTopic = (AIMLTopic)null;
     }
     else if (!(this._aktDatei is AIMLDatei))
     {
         this.AktAIMLTopic = (AIMLTopic)null;
     }
     else
     {
         AIMLDatei aktDatei = (AIMLDatei)this._aktDatei;
         IOrderedEnumerable <AIMLTopic> source = aktDatei.getTopics().OrderBy <AIMLTopic, string>((Func <AIMLTopic, string>)(t => t.Name));
         AIMLTopic dateiGewaehlesTopic         = aktDatei.ZuletztInDieserDateiGewaehlesTopic;
         if (dateiGewaehlesTopic != null && source.Contains <AIMLTopic>(dateiGewaehlesTopic))
         {
             this.AktAIMLTopic = dateiGewaehlesTopic;
         }
         else
         {
             this.AktAIMLTopic = source.Count <AIMLTopic>() != 0 ? source.First <AIMLTopic>() : (AIMLTopic)null;
         }
     }
 }
Esempio n. 11
0
 public static AIMLCategory createNewCategory(
     AIMLTopic topic,
     XmlNode newCategoryNode)
 {
     topic.TopicNode.AppendChild(newCategoryNode);
     return(new AIMLCategory(newCategoryNode, topic));
 }
Esempio n. 12
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;
 }
Esempio n. 13
0
 protected virtual void AktAIMLTopicChangedEvent(AIMLTopic topic)
 {
     if (this.AktAIMLTopicChanged == null)
     {
         return;
     }
     this.AktAIMLTopicChanged((object)this, new ArbeitsbereichFokus.AktAIMLTopicChangedEventArgs(topic));
 }
Esempio n. 14
0
 public AIMLCategory(XmlNode categoryNode, AIMLTopic topic)
 {
     this._node  = categoryNode;
     this._topic = topic;
     this._node.OwnerDocument.NodeChanged  += this.OwnerDocument_NodeChanged;
     this._node.OwnerDocument.NodeInserted += this.OwnerDocument_NodeChanged;
     this._node.OwnerDocument.NodeRemoved  += this.OwnerDocument_NodeChanged;
 }
Esempio n. 15
0
 public AIMLCategory(XmlNode categoryNode, AIMLTopic topic)
 {
     this._node  = categoryNode;
     this._topic = topic;
     this._node.OwnerDocument.NodeChanged  += new XmlNodeChangedEventHandler(this.OwnerDocument_NodeChanged);
     this._node.OwnerDocument.NodeInserted += new XmlNodeChangedEventHandler(this.OwnerDocument_NodeChanged);
     this._node.OwnerDocument.NodeRemoved  += new XmlNodeChangedEventHandler(this.OwnerDocument_NodeChanged);
 }
Esempio n. 16
0
        public static AIMLCategory createNewCategory(AIMLTopic topic)
        {
            XmlTextReader xmlTextReader = new XmlTextReader("<category><pattern></pattern><template></template></category>", XmlNodeType.Element, (XmlParserContext)null);
            int           content       = (int)xmlTextReader.MoveToContent();
            XmlNode       xmlNode       = topic.TopicNode.OwnerDocument.ReadNode((XmlReader)xmlTextReader);

            topic.TopicNode.AppendChild(xmlNode);
            return(new AIMLCategory(xmlNode, topic));
        }
Esempio n. 17
0
 private void AIMLTopicDurchsuchen(AIMLTopic topic, string suchEingabe)
 {
     if (topic != null)
     {
         foreach (AIMLCategory category in topic.Categories)
         {
             this.AIMLCategoryDurchsuchen(category, suchEingabe);
         }
     }
 }
Esempio n. 18
0
 private void ListenEintragBeschriften(ListViewItem item)
 {
   AIMLTopic tag = (AIMLTopic) item.Tag;
   string name = tag.Name;
   if (item.Text != name)
     item.Text = name;
   bool flag = tag == this.AktuellesThema;
   if (item.Selected == flag)
     return;
   item.Selected = flag;
 }
Esempio n. 19
0
 private AIMLTopic TopicUnterPos(Point screenPos)
 {
   Point client = this.listThemen.PointToClient(screenPos);
   ListViewItem itemAt = this.listThemen.GetItemAt(client.X, client.Y);
   if (itemAt == null)
     return (AIMLTopic) null;
   AIMLTopic tag = (AIMLTopic) itemAt.Tag;
   if (tag != null)
     return tag;
   return (AIMLTopic) null;
 }
Esempio n. 20
0
 private void listThemen_MouseMove(object sender, MouseEventArgs e)
 {
   if (this.DateiIstReadOnly || e.Button != MouseButtons.Left)
     return;
   AIMLTopic aktuellesThema = this.AktuellesThema;
   if (aktuellesThema != null && !aktuellesThema.IstRootTopic && this.listThemen.DoDragDrop((object) aktuellesThema, DragDropEffects.Copy | DragDropEffects.Move) == DragDropEffects.Move)
   {
     this.AimlDatei.LoescheTopic(aktuellesThema);
     this._arbeitsbereich.Fokus.BestesTopicSelektieren();
   }
 }
Esempio n. 21
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();
        }
Esempio n. 22
0
 public bool LoescheTopic(AIMLTopic topic)
 {
     if (topic == null || topic.IstRootTopic)
     {
         return(false);
     }
     if (this._topicListe.Contains(topic))
     {
         this._topicListe.Remove(topic);
     }
     this.Arbeitsbereich.Verlauf.AlleVerweiseDiesesAIMLTopicEntfernen(topic);
     topic.Delete();
     topic.Dispose();
     return(true);
 }
Esempio n. 23
0
 private void ToolStripButtonsAnzeigen()
 {
   this.toolStripButtonNeuesThema.Enabled = !this.DateiIstReadOnly;
   AIMLTopic aktuellesThema = this.AktuellesThema;
   if (aktuellesThema == null || this.DateiIstReadOnly)
   {
     this.toolStripButtonTopicLoeschen.Enabled = false;
     this.toolStripButtonTopicUmbenennen.Enabled = false;
   }
   else
   {
     this.toolStripButtonTopicLoeschen.Enabled = !aktuellesThema.IstRootTopic;
     this.toolStripButtonTopicUmbenennen.Enabled = !aktuellesThema.IstRootTopic;
   }
 }
 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;
         }
     }
 }
        private AIMLTopic TopicUnterPos(Point screenPos)
        {
            Point        point  = this.listThemen.PointToClient(screenPos);
            ListViewItem itemAt = this.listThemen.GetItemAt(point.X, point.Y);

            if (itemAt != null)
            {
                AIMLTopic aIMLTopic = (AIMLTopic)itemAt.Tag;
                if (aIMLTopic != null)
                {
                    return(aIMLTopic);
                }
                return(null);
            }
            return(null);
        }
        private void ListenEintragBeschriften(ListViewItem item)
        {
            AIMLTopic aIMLTopic = (AIMLTopic)item.Tag;
            string    name      = aIMLTopic.Name;

            if (item.Text != name)
            {
                item.Text = name;
            }
            bool flag = aIMLTopic == this.AktuellesThema;

            if (item.Selected != flag)
            {
                item.Selected = flag;
            }
        }
Esempio n. 27
0
 private void AktuellesTopicLoeschen()
 {
   if (this.DateiIstReadOnly)
     return;
   AIMLTopic aktuellesThema = this.AktuellesThema;
   if (aktuellesThema == null)
     return;
   if (aktuellesThema.IstRootTopic)
   {
     int num = (int) MessageBox.Show(ResReader.Reader.GetString("RootTopicKannNichtGeloeschtWerden"));
   }
   else if (MessageBox.Show(string.Format(ResReader.Reader.GetString("SollDasThemaWirklichGeloeschtWerden"), (object) aktuellesThema.Name), ResReader.Reader.GetString("ThemaLoeschen"), MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
   {
     this.AimlDatei.LoescheTopic(aktuellesThema);
     this._arbeitsbereich.Fokus.BestesTopicSelektieren();
   }
 }
 private void dataGridViewCategories_MouseMove(object sender, MouseEventArgs e)
 {
     if (!this.DateiIstReadOnly && e.Button == MouseButtons.Left && this.AktuelleCategory != null)
     {
         AIMLCategory    aktuelleCategory = this.AktuelleCategory;
         DragDropEffects dragDropEffects  = this.dataGridViewCategories.DoDragDrop(aktuelleCategory, DragDropEffects.Copy | DragDropEffects.Move);
         if (dragDropEffects == DragDropEffects.Move && aktuelleCategory != null)
         {
             AIMLTopic    aIMLTopic = aktuelleCategory.AIMLTopic;
             AIMLCategory naechstLiegendeCategory = this.GetNaechstLiegendeCategory(aktuelleCategory);
             aIMLTopic.LoescheCategory(aktuelleCategory);
             this.AIMLCategoriesNeuAnzeigen(false);
             if (naechstLiegendeCategory != null)
             {
                 this.AktuelleCategory = naechstLiegendeCategory;
             }
             else
             {
                 this._arbeitsbereich.Fokus.BesteCategorySelektieren();
             }
             this.ZeilenInhalteRefreshen();
         }
     }
 }
Esempio n. 29
0
 private void DateiListenAnzeige_DragEnter(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(typeof(AIMLTopic)))
     {
         AIMLTopic data = (AIMLTopic)e.Data.GetData(typeof(AIMLTopic));
         if (data != null)
         {
             IArbeitsbereichDatei arbeitsbereichDatei = this.DateiUnterPos(new Point(e.X, e.Y));
             if (arbeitsbereichDatei != null && !arbeitsbereichDatei.ReadOnly)
             {
                 if (arbeitsbereichDatei != data.AIMLDatei)
                 {
                     e.Effect = DragDropEffects.Move;
                 }
                 else
                 {
                     e.Effect = DragDropEffects.None;
                 }
             }
             else
             {
                 e.Effect = DragDropEffects.None;
             }
         }
         else
         {
             e.Effect = DragDropEffects.None;
         }
     }
     else if (e.Data.GetDataPresent(typeof(AIMLCategory)))
     {
         AIMLCategory data = (AIMLCategory)e.Data.GetData(typeof(AIMLCategory));
         if (data != null)
         {
             IArbeitsbereichDatei arbeitsbereichDatei = this.DateiUnterPos(new Point(e.X, e.Y));
             if (arbeitsbereichDatei != null && !arbeitsbereichDatei.ReadOnly)
             {
                 if (arbeitsbereichDatei != data.AIMLTopic.AIMLDatei)
                 {
                     e.Effect = DragDropEffects.Move;
                 }
                 else
                 {
                     e.Effect = DragDropEffects.None;
                 }
             }
             else
             {
                 e.Effect = DragDropEffects.None;
             }
         }
         else
         {
             e.Effect = DragDropEffects.None;
         }
     }
     else
     {
         e.Effect = DragDropEffects.None;
     }
 }
Esempio n. 30
0
 private void DateiListenAnzeige_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(typeof(AIMLCategory)))
     {
         AIMLCategory data = (AIMLCategory)e.Data.GetData(typeof(AIMLCategory));
         if (data == null)
         {
             return;
         }
         IArbeitsbereichDatei arbeitsbereichDatei = this.DateiUnterPos(new Point(e.X, e.Y));
         if (arbeitsbereichDatei != null && !arbeitsbereichDatei.ReadOnly)
         {
             if (arbeitsbereichDatei != data.AIMLTopic.AIMLDatei)
             {
                 if (arbeitsbereichDatei is AIMLDatei)
                 {
                     ((AIMLDatei)arbeitsbereichDatei).RootTopic.AddNewCategory().ContentNode.InnerXml = data.ContentNode.InnerXml;
                     e.Effect = DragDropEffects.Move;
                 }
             }
             else
             {
                 e.Effect = DragDropEffects.None;
             }
         }
         else
         {
             e.Effect = DragDropEffects.None;
         }
     }
     else if (e.Data.GetDataPresent(typeof(AIMLTopic)))
     {
         AIMLTopic data = (AIMLTopic)e.Data.GetData(typeof(AIMLTopic));
         if (data == null)
         {
             return;
         }
         IArbeitsbereichDatei arbeitsbereichDatei = this.DateiUnterPos(new Point(e.X, e.Y));
         if (arbeitsbereichDatei != null && !arbeitsbereichDatei.ReadOnly)
         {
             if (arbeitsbereichDatei != data.AIMLDatei)
             {
                 if (arbeitsbereichDatei is AIMLDatei)
                 {
                     AIMLTopic aimlTopic = ((AIMLDatei)arbeitsbereichDatei).AddNewTopic();
                     aimlTopic.TopicNode.InnerXml = data.TopicNode.InnerXml;
                     aimlTopic.Name = data.Name;
                     e.Effect       = DragDropEffects.Move;
                 }
             }
             else
             {
                 e.Effect = DragDropEffects.None;
             }
         }
         else
         {
             e.Effect = DragDropEffects.None;
         }
     }
     else
     {
         e.Effect = DragDropEffects.None;
     }
 }