Exemple #1
0
 public Range(Cursor start)
 {
     StartRow = start.Row;
     StartColumn = start.Column;
     EndRow = start.Row;
     EndColumn = 0;
 }
Exemple #2
0
        public Pad()
        {
            Lines = new ObservableCollection<Line>{ new Line { Text = "" } };
            Cursor = new Cursor { Column = 0, Row = 0, Type = CursorType.Box };

            if (!DataStore.TableExists("pad"))
                MakeTable();
            Load();

            Lines[0].Cursor = Cursor;
        }
Exemple #3
0
 public Insert(Cursor position, string text)
 {
     this.position = position.Clone() as Cursor;
     this.text = text;
 }
Exemple #4
0
 public void InsertText(Cursor cursor, string text)
 {
     if(text.Contains('\n')) {
         var lines = text.Split('\n');
         foreach(string line in lines.Take(lines.Count() - 1)) {
             InsertLine(cursor.Row, line);
             cursor.Row += 1;
         }
     }
     else {
         Lines[cursor.Row].Text = Lines[cursor.Row].Text.Insert(
                 cursor.Column,
                 text);
         cursor.Column += text.Length;
     }
 }