Exemple #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;
            };
        }
Exemple #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;
            };
        }