Esempio n. 1
0
        public NoteView(string dir)
        {
            directory = dir;
            notes = new List<Note>();

            ListBox  = new Eto.Forms.ListBox()  { Style = "ListNative" };
            TextArea = new Eto.Forms.TextArea() { Style = "TextConsole" };

            TextArea.TextChanged += delegate
            {
                if (ListBox.SelectedIndex < 0) return;
                bool changed = notes[ListBox.SelectedIndex].Changed;
                notes[ListBox.SelectedIndex].Content = TextArea.Text;
                if (changed != notes[ListBox.SelectedIndex].Changed) ListBox.Invalidate();
            };

            ListBox.SelectedIndexChanged += delegate
            {
                if (ListBox.SelectedIndex < 0) return;
                TextArea.Text = notes[ListBox.SelectedIndex].Content;
            };
        }
Esempio n. 2
0
        public NoteView(string dir)
        {
            directory = dir;
            notes     = new List <Note>();

            ListBox = new Eto.Forms.ListBox()
            {
                Style = "ListNative"
            };
            TextArea = new Eto.Forms.TextArea()
            {
                Style = "TextConsole"
            };

            TextArea.TextChanged += delegate
            {
                if (ListBox.SelectedIndex < 0)
                {
                    return;
                }
                bool changed = notes[ListBox.SelectedIndex].Changed;
                notes[ListBox.SelectedIndex].Content = TextArea.Text;
                if (changed != notes[ListBox.SelectedIndex].Changed)
                {
                    ListBox.Invalidate();
                }
            };

            ListBox.SelectedIndexChanged += delegate
            {
                if (ListBox.SelectedIndex < 0)
                {
                    return;
                }
                TextArea.Text = notes[ListBox.SelectedIndex].Content;
            };
        }
Esempio n. 3
0
 public ListBox()
 {
     EtoListBox = new Eto.Forms.ListBox();
     EtoControl = EtoListBox;
     Items      = new ListItemCollection(EtoListBox);
 }