Esempio n. 1
0
 void OnLineCountChanged(LineCountChangeEventArgs e)
 {
     if (LineCountChanged != null)
     {
         LineCountChanged(this, e);
     }
 }
 void OnLineCountChanged(LineCountChangeEventArgs e)
 {
   if (LineCountChanged != null)
   {
     LineCountChanged(this, e);
   }
 }
    /// <summary>
    /// This method moves all indices from index upward count lines
    /// (useful for deletion/insertion of text)
    /// </summary>
    void MoveIndices(object sender, LineCountChangeEventArgs e)
    {
      bool changed = false;
      OnBeforeChanged();
      for (int i = 0; i < lines.Count; ++i)
      {
        int startLineNr = ((CustomLine) lines[i]).StartLineNr;
        int endLineNr = ((CustomLine) lines[i]).EndLineNr;
        if (e.LineStart >= startLineNr && e.LineStart < endLineNr)
        {
          changed = true;
          ((CustomLine) lines[i]).EndLineNr += e.LinesMoved;
        }
        else if (e.LineStart < startLineNr)
        {
          ((CustomLine) lines[i]).StartLineNr += e.LinesMoved;
          ((CustomLine) lines[i]).EndLineNr += e.LinesMoved;
        }
        else
        {
        }
      }

      if (changed)
        OnChanged();
    }