示例#1
0
 public void SelektionOptimieren()
 {
     if (this._startPos.AktNode == null)
     {
         return;
     }
     if (this._startPos.AktNode == this._endPos.AktNode)
     {
         if (this._startPos.PosAmNode > this._endPos.PosAmNode)
         {
             XMLCursorPositionen posAmNode = this._startPos.PosAmNode;
             int posImTextnode             = this._startPos.PosImTextnode;
             this._startPos.CursorSetzen(this._endPos.AktNode, this._endPos.PosAmNode, this._endPos.PosImTextnode);
             this._endPos.CursorSetzen(this._endPos.AktNode, posAmNode, posImTextnode);
         }
         else if (this._startPos.PosAmNode == XMLCursorPositionen.CursorInnerhalbDesTextNodes && this._endPos.PosAmNode == XMLCursorPositionen.CursorInnerhalbDesTextNodes && this._startPos.PosImTextnode > this._endPos.PosImTextnode)
         {
             int posImTextnode = this._startPos.PosImTextnode;
             this._startPos.CursorSetzen(this._startPos.AktNode, XMLCursorPositionen.CursorInnerhalbDesTextNodes, this._endPos.PosImTextnode);
             this._endPos.CursorSetzen(this._startPos.AktNode, XMLCursorPositionen.CursorInnerhalbDesTextNodes, posImTextnode);
         }
     }
     else
     {
         if (ToolboxXML.Node1LiegtVorNode2(this._endPos.AktNode, this._startPos.AktNode))
         {
             XMLCursorPos startPos = this._startPos;
             this._startPos = this._endPos;
             this._endPos   = startPos;
         }
         if (ToolboxXML.IstChild(this._endPos.AktNode, this._startPos.AktNode))
         {
             this.BeideCursorPosSetzen(this._startPos.AktNode, XMLCursorPositionen.CursorAufNodeSelbstVorderesTag);
         }
         if (this._startPos.AktNode.ParentNode != this._endPos.AktNode.ParentNode)
         {
             XmlNode xmlNode  = this.TiefsterGemeinsamerParent(this._startPos.AktNode, this._endPos.AktNode);
             XmlNode aktNode1 = this._startPos.AktNode;
             while (aktNode1.ParentNode != xmlNode)
             {
                 aktNode1 = aktNode1.ParentNode;
             }
             XmlNode aktNode2 = this._endPos.AktNode;
             while (aktNode2.ParentNode != xmlNode)
             {
                 aktNode2 = aktNode2.ParentNode;
             }
             this._startPos.CursorSetzen(aktNode1, XMLCursorPositionen.CursorAufNodeSelbstVorderesTag);
             this._endPos.CursorSetzen(aktNode2, XMLCursorPositionen.CursorAufNodeSelbstVorderesTag);
         }
     }
 }
示例#2
0
 public bool LiegtNodeVorDieserPos(XmlNode node)
 {
     return(ToolboxXML.Node1LiegtVorNode2(node, this._aktNode));
 }