public AnnotationEditorModel(IChorusUser user,
							MessageSelectedEvent messageSelectedEventToSubscribeTo,
							StyleSheet styleSheet,
							EmbeddedMessageContentHandlerRepository embeddedMessageContentHandlerRepository,
							NavigateToRecordEvent navigateToRecordEventToRaise,
						ChorusNotesDisplaySettings displaySettings)
        {
            _user = user;
            m_embeddedMessageContentHandlerRepository = embeddedMessageContentHandlerRepository;
            _navigateToRecordEventToRaise = navigateToRecordEventToRaise;
            _styleSheet = styleSheet;
            _displaySettings = displaySettings;
            messageSelectedEventToSubscribeTo.Subscribe(SetAnnotationAndFocussedMessage);
            EventToRaiseForChangedMessage = messageSelectedEventToSubscribeTo;
        }
Example #2
0
 public AnnotationEditorModel(IChorusUser user,
                              MessageSelectedEvent messageSelectedEventToSubscribeTo,
                              StyleSheet styleSheet,
                              EmbeddedMessageContentHandlerRepository embeddedMessageContentHandlerRepository,
                              NavigateToRecordEvent navigateToRecordEventToRaise,
                              ChorusNotesDisplaySettings displaySettings)
 {
     _user = user;
     m_embeddedMessageContentHandlerRepository = embeddedMessageContentHandlerRepository;
     _navigateToRecordEventToRaise             = navigateToRecordEventToRaise;
     _styleSheet      = styleSheet;
     _displaySettings = displaySettings;
     messageSelectedEventToSubscribeTo.Subscribe(SetAnnotationAndFocussedMessage);
     EventToRaiseForChangedMessage = messageSelectedEventToSubscribeTo;
 }
        //TODO: think about or merge these two constructors. this one is for when we're just
        //showing the control with a single annotation... it isn't tied to a list of messages.
        public AnnotationEditorModel(IChorusUser user,
		   StyleSheet styleSheet,
		   EmbeddedMessageContentHandlerRepository embeddedMessageContentHandlerRepository,
			Annotation annotation,
			NavigateToRecordEvent navigateToRecordEventToRaise,
			ChorusNotesDisplaySettings displaySettings,
			bool showLabelAsHyperlink)
        {
            _user = user;
            m_embeddedMessageContentHandlerRepository = embeddedMessageContentHandlerRepository;
            _styleSheet = styleSheet;
            _annotation = annotation;
            _navigateToRecordEventToRaise = navigateToRecordEventToRaise;
            _displaySettings = displaySettings;
            _showLabelAsHyperLink = showLabelAsHyperlink;
        }
Example #4
0
 //TODO: think about or merge these two constructors. this one is for when we're just
 //showing the control with a single annotation... it isn't tied to a list of messages.
 public AnnotationEditorModel(IChorusUser user,
                              StyleSheet styleSheet,
                              EmbeddedMessageContentHandlerRepository embeddedMessageContentHandlerRepository,
                              Annotation annotation,
                              NavigateToRecordEvent navigateToRecordEventToRaise,
                              ChorusNotesDisplaySettings displaySettings,
                              bool showLabelAsHyperlink)
 {
     _user = user;
     m_embeddedMessageContentHandlerRepository = embeddedMessageContentHandlerRepository;
     _styleSheet = styleSheet;
     _annotation = annotation;
     _navigateToRecordEventToRaise = navigateToRecordEventToRaise;
     _displaySettings      = displaySettings;
     _showLabelAsHyperLink = showLabelAsHyperlink;
 }
Example #5
0
 public AnnotationEditorModel(IChorusUser user,
                     MessageSelectedEvent messageSelectedEventToSubscribeTo,
                     StyleSheet styleSheet,
                     EmbeddedMessageContentHandlerRepository embeddedMessageContentHandlerRepository,
                     NavigateToRecordEvent navigateToRecordEventToRaise,
                 ChorusNotesDisplaySettings displaySettings)
 {
     _user = user;
     m_embeddedMessageContentHandlerRepository = embeddedMessageContentHandlerRepository;
     _navigateToRecordEventToRaise = navigateToRecordEventToRaise;
     _styleSheet = styleSheet;
     _displaySettings = displaySettings;
      //CurrentWritingSystem = _displaySettings.First();
     messageSelectedEventToSubscribeTo.Subscribe((annotation, message) => SetAnnotationAndFocussedMessage(annotation, message));
     EventToRaiseForChangedMessage = messageSelectedEventToSubscribeTo;
     NewMessageText = string.Empty;
 }
Example #6
0
 public ListViewItem GetListViewItem(ChorusNotesDisplaySettings displaySettings)
 {
     var i = new ListViewItem(ParentAnnotation.GetLabelFromRef(""));
     i.Tag = this;
     if(_sLabelFont==null)
     {
         //we cache this to save memory
         _sLabelFont = new Font(displaySettings.WritingSystemForNoteLabel.FontName, 10);
     }
     //note: while we would like to just use this font for the label column, this winform ui component
     //doesn't support different fonts.
     i.Font = _sLabelFont;
     var sub = i.SubItems.Add(Message.GetAuthor("?"));
     i.SubItems.Add(Message.Date.ToShortDateString());
     SetListViewImage(i);
     return i;
 }
Example #7
0
        public ListViewItem GetListViewItem(ChorusNotesDisplaySettings displaySettings)
        {
            var i = new ListViewItem(ParentAnnotation.GetLabelFromRef(""));

            i.Tag = this;
            if (_sLabelFont == null)
            {
                //we cache this to save memory
                _sLabelFont = new Font(displaySettings.WritingSystemForNoteLabel.FontName, 10);
            }
            //note: while we would like to just use this font for the label column, this winform ui component
            //doesn't support different fonts.
            i.Font = _sLabelFont;
            i.SubItems.Add(Message.GetAuthor("?"));
            i.SubItems.Add(Message.Date.ToShortDateString());
            SetListViewImage(i);
            return(i);
        }
Example #8
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);
        }
Example #9
0
 /// <summary>
 /// Constructor. Need to Init after this
 /// </summary>
 /// <param name="dataFolderPath">The root of the project</param>
 public ChorusSystem(string dataFolderPath)
 {
     DisplaySettings = new ChorusNotesDisplaySettings();
     _dataFolderPath = dataFolderPath;
 }