예제 #1
0
        private void ShowBrowser(IEnumerable <AnnotationRepository> repositories)
        {
            //TODO (jh/jh): something here seems screwed up... we create a NotesInProjectViewModel here, and yet so does the NotesBrowserPage

            var messageSelected            = new MessageSelectedEvent();
            var chorusNotesDisplaySettings = new ChorusNotesDisplaySettings()
            {
                WritingSystemForNoteLabel   = new TestWritingSystem("Algerian"),
                WritingSystemForNoteContent = new TestWritingSystem("Bradley Hand ITC")
            };

            NotesInProjectViewModel notesInProjectModel = new NotesInProjectViewModel(new ChorusUser("Bob"), repositories, chorusNotesDisplaySettings, new ConsoleProgress());

            var annotationModel = new AnnotationEditorModel(new ChorusUser("bob"), messageSelected, StyleSheet.CreateFromDisk(),
                                                            new EmbeddedMessageContentHandlerRepository(), new NavigateToRecordEvent(), chorusNotesDisplaySettings);
            AnnotationEditorView annotationView = new AnnotationEditorView(annotationModel);

            annotationView.ModalDialogMode = false;
            var page = new NotesBrowserPage((unusedRepos, progress) => notesInProjectModel, repositories, annotationView);

            page.Dock = DockStyle.Fill;
            var form = new Form();

            form.Size = new Size(700, 600);
            form.Controls.Add(page);

            Application.EnableVisualStyles();
            Application.Run(form);
        }
예제 #2
0
 public NoteDetailDialog(Annotation annotation, AnnotationEditorModel.Factory viewModelFactory)
 {
     InitializeComponent();
     var model = viewModelFactory(annotation, false);
     Text = model.GetLongLabel();
     _view = new AnnotationEditorView(model);
     _view.ModalDialogMode = true;
     _view.Dock = DockStyle.Fill;
     //_view.Size  = new Size(Width, Height - 50);
     Controls.Add(_view);
     AcceptButton = _view.OKButton;
     _view.OnClose += (CloseButton_Click);
 }
예제 #3
0
        public NoteDetailDialog(Annotation annotation, AnnotationEditorModel.Factory viewModelFactory)
        {
            InitializeComponent();
            var model = viewModelFactory(annotation, false);

            Text  = model.GetLongLabel();
            _view = new AnnotationEditorView(model);
            _view.ModalDialogMode = true;
            _view.Dock            = DockStyle.Fill;
            //_view.Size  = new Size(Width, Height - 50);
            Controls.Add(_view);
            AcceptButton   = _view.OKButton;
            _view.OnClose += (CloseButton_Click);
        }
예제 #4
0
        public NotesBrowserPage(NotesInProjectViewModel.Factory notesInProjectViewModelFactory, IEnumerable<AnnotationRepository> repositories, AnnotationEditorView annotationView)
        {
            InitializeComponent();
            this.Font = SystemFonts.MessageBoxFont;

            SuspendLayout();
            annotationView.ModalDialogMode = false;
            annotationView.Dock = DockStyle.Fill;
            annotationView.ModalDialogMode = false;
            annotationView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            splitContainer1.Panel2.Padding = new Padding(3,34,3,3);//drop it below the search box of the other pain

            _notesInProjectModel = notesInProjectViewModelFactory(repositories, new NullProgress());
            _notesInProjectModel.EventToRaiseForChangedMessage = annotationView.EventToRaiseForChangedMessage;
            var notesInProjectView = new NotesInProjectView(_notesInProjectModel);
            notesInProjectView.Dock = DockStyle.Fill;
            splitContainer1.Panel1.Controls.Add(notesInProjectView);
            splitContainer1.Panel2.Controls.Add(annotationView);
            ResumeLayout();
        }
예제 #5
0
        public NotesBrowserPage(NotesInProjectViewModel.Factory notesInProjectViewModelFactory,
                                IEnumerable <AnnotationRepository> repositories, AnnotationEditorView annotationView)
        {
            InitializeComponent();
            this.Font = SystemFonts.MessageBoxFont;

            _annotationView = annotationView;

            SuspendLayout();
            _annotationView.ModalDialogMode = false;
            _annotationView.Dock            = DockStyle.Fill;
            _annotationView.BorderStyle     = System.Windows.Forms.BorderStyle.FixedSingle;
            splitContainer1.Panel2.Padding  = new Padding(3, 34, 3, 3);        //drop it below the search box of the other pane

            _notesInProjectModel = notesInProjectViewModelFactory(repositories, new NullProgress());
            _notesInProjectModel.EventToRaiseForChangedMessage += _notesView_SelectionChanged;
            var notesInProjectView = new NotesInProjectView(_notesInProjectModel);

            notesInProjectView.Dock = DockStyle.Fill;

            splitContainer1.Panel1.Controls.Add(notesInProjectView);
            splitContainer1.Panel2.Controls.Add(_annotationView);
            ResumeLayout();
        }