public bool AktionNodeOderZeichenHinterCursorPosLoeschen(XMLCursorPos position, UndoSnapshotSetzenOptionen undoSnapshotSetzen)
        {
            if (!this.AktionenMoeglich)
            {
                return(false);
            }
            if (undoSnapshotSetzen == UndoSnapshotSetzenOptionen.ja)
            {
                this._undoHandler.SnapshotSetzen(ResReader.Reader.GetString("AktionLoeschen"), this._cursor);
            }
            XMLCursor xMLCursor = new XMLCursor();

            xMLCursor.StartPos.CursorSetzen(position.AktNode, position.PosAmNode, position.PosImTextnode);
            XMLCursorPos xMLCursorPos = xMLCursor.StartPos.Clone();

            xMLCursorPos.MoveRight(this._rootNode, this.Regelwerk);
            xMLCursor.EndPos.CursorSetzen(xMLCursorPos.AktNode, xMLCursorPos.PosAmNode, xMLCursorPos.PosImTextnode);
            xMLCursor.SelektionOptimieren();
            if (xMLCursor.StartPos.AktNode == this._rootNode)
            {
                return(false);
            }
            XMLCursorPos xMLCursorPos2 = default(XMLCursorPos);

            if (xMLCursor.SelektionLoeschen(out xMLCursorPos2))
            {
                this._cursor.BeideCursorPosSetzen(xMLCursorPos2.AktNode, xMLCursorPos2.PosAmNode, xMLCursorPos2.PosImTextnode);
                this._cursor.ErzwingeChanged();
                this.ContentChanged();
                return(true);
            }
            return(false);
        }
Example #2
0
        public bool AktionNodeOderZeichenHinterCursorPosLoeschen(
            XMLCursorPos position,
            XMLEditor.UndoSnapshotSetzenOptionen undoSnapshotSetzen)
        {
            if (!this.AktionenMoeglich)
            {
                return(false);
            }
            if (undoSnapshotSetzen == XMLEditor.UndoSnapshotSetzenOptionen.ja)
            {
                this._undoHandler.SnapshotSetzen(de.springwald.xml.ResReader.Reader.GetString("AktionLoeschen"), this._cursor);
            }
            XMLCursor xmlCursor = new XMLCursor();

            xmlCursor.StartPos.CursorSetzen(position.AktNode, position.PosAmNode, position.PosImTextnode);
            XMLCursorPos xmlCursorPos = xmlCursor.StartPos.Clone();

            xmlCursorPos.MoveRight(this._rootNode, this.Regelwerk);
            xmlCursor.EndPos.CursorSetzen(xmlCursorPos.AktNode, xmlCursorPos.PosAmNode, xmlCursorPos.PosImTextnode);
            xmlCursor.SelektionOptimieren();
            XMLCursorPos neueCursorPosNachLoeschen;

            if (xmlCursor.StartPos.AktNode == this._rootNode || !xmlCursor.SelektionLoeschen(out neueCursorPosNachLoeschen))
            {
                return(false);
            }
            this._cursor.BeideCursorPosSetzen(neueCursorPosNachLoeschen.AktNode, neueCursorPosNachLoeschen.PosAmNode, neueCursorPosNachLoeschen.PosImTextnode);
            this._cursor.ErzwingeChanged();
            this.ContentChanged();
            return(true);
        }
        public virtual bool AktionDelete(UndoSnapshotSetzenOptionen undoSnapshotSetzen)
        {
            if (!this.AktionenMoeglich)
            {
                return(false);
            }
            if (this.IstRootNodeSelektiert)
            {
                return(false);
            }
            if (undoSnapshotSetzen == UndoSnapshotSetzenOptionen.ja)
            {
                this._undoHandler.SnapshotSetzen(ResReader.Reader.GetString("AktionLoeschen"), this._cursor);
            }
            XMLCursor cursor = this._cursor;

            cursor.SelektionOptimieren();
            XMLCursorPos xMLCursorPos = default(XMLCursorPos);

            if (cursor.SelektionLoeschen(out xMLCursorPos))
            {
                this._cursor.BeideCursorPosSetzen(xMLCursorPos.AktNode, xMLCursorPos.PosAmNode, xMLCursorPos.PosImTextnode);
                this.ContentChanged();
                return(true);
            }
            return(false);
        }
Example #4
0
        public virtual bool AktionDelete(
            XMLEditor.UndoSnapshotSetzenOptionen undoSnapshotSetzen)
        {
            if (!this.AktionenMoeglich || this.IstRootNodeSelektiert)
            {
                return(false);
            }
            if (undoSnapshotSetzen == XMLEditor.UndoSnapshotSetzenOptionen.ja)
            {
                this._undoHandler.SnapshotSetzen(de.springwald.xml.ResReader.Reader.GetString("AktionLoeschen"), this._cursor);
            }
            XMLCursor cursor = this._cursor;

            cursor.SelektionOptimieren();
            XMLCursorPos neueCursorPosNachLoeschen;

            if (!cursor.SelektionLoeschen(out neueCursorPosNachLoeschen))
            {
                return(false);
            }
            this._cursor.BeideCursorPosSetzen(neueCursorPosNachLoeschen.AktNode, neueCursorPosNachLoeschen.PosAmNode, neueCursorPosNachLoeschen.PosImTextnode);
            this.ContentChanged();
            return(true);
        }