/// <summary>
        /// This method moves all indices from index upward count lines
        /// (useful for deletion/insertion of text)
        /// </summary>
        void MoveIndices(object sender, LineManagerEventArgs e)
        {
            bool changed = false;

            OnBeforeChanged();
            for (int i = 0; i < bookmark.Count; ++i)
            {
                int mark = (int)bookmark[i];
                if (e.LinesMoved < 0 && mark == e.LineStart)
                {
                    bookmark.RemoveAt(i);
                    --i;
                    changed = true;
                }
                else if (mark > e.LineStart + 1 || (e.LinesMoved < 0 && mark > e.LineStart))
                {
                    changed     = true;
                    bookmark[i] = mark + e.LinesMoved;
                }
            }

            if (changed)
            {
                OnChanged();
            }
        }
 protected virtual void OnLineCountChanged(LineManagerEventArgs e)
 {
     if (LineCountChanged != null)
     {
         LineCountChanged(this, e);
     }
 }
Exemplo n.º 3
0
		/// <summary>
		/// This method moves all indices from index upward count lines
		/// (useful for deletion/insertion of text)
		/// </summary>
		void MoveIndices(object sender,LineManagerEventArgs e)
		{
			bool changed = false;
			OnBeforeChanged();
			for (int i = 0; i < bookmark.Count; ++i) {
				int mark = (int)bookmark[i];
				if (e.LinesMoved < 0 && mark == e.LineStart) {
					bookmark.RemoveAt(i);
					--i;
					changed = true;
				} else if (mark > e.LineStart + 1 || (e.LinesMoved < 0 && mark > e.LineStart))  {
					changed = true;
					bookmark[i] = mark + e.LinesMoved;
				}
			}
			
			if (changed) {
				OnChanged();
			}
		}
		protected virtual void OnLineCountChanged(LineManagerEventArgs e)
		{
			if (LineCountChanged != null) {
				LineCountChanged(this, e);
			}
		}