Ejemplo n.º 1
0
 public static void OnMoveDocumentIndex(object sender, MoveDocumentIndexEventArgs e)
 {
     if (MoveDocumentIndexEventRised != null)
     {
         MoveDocumentIndexEventRised(sender, e);
     }
 }
Ejemplo n.º 2
0
 public static void OnMoveDocumentIndex(object sender, MoveDocumentIndexEventArgs e)
 {
     if(MoveDocumentIndexEventRised != null)
     {
         MoveDocumentIndexEventRised(sender, e);
     }
 }
        /// <summary>
        /// 検索とか置換でドキュメントが変化したときのイベント
        /// </summary>
        private void OnMoveDocumentIndex(object obj, MoveDocumentIndexEventArgs args)
        {
            if(_writersBFView.Editor.GetText().Length < args.headIndex)
            {
                return ;
            }

            int line = _writersBFView.GetLineIndexFromCharacterIndex(args.headIndex);

            MoveLineAt(line);

            if (_writersBFView.Editor.GetText().Length > args.headIndex + args.targetText.Length)
            {
                string str = _writersBFView.Editor.GetText().Substring(args.headIndex, args.targetText.Length);
                if (args.targetText.Equals(str))
                {
                    _writersBFView.Editor.Select(args.headIndex, args.targetText.Length);
                    _writersBFView.Editor.Focus();
                }
            }
        }