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; }
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; }
public string GetHtmlText(EmbeddedMessageContentHandlerRepository embeddedMessageContentHandlerRepository) { var b = new StringBuilder(); b.Append(Text); if (embeddedMessageContentHandlerRepository != null) { XCData cdata = _element.Nodes().OfType <XCData>().FirstOrDefault(); if (cdata != null) { string content = cdata.Value; var handler = embeddedMessageContentHandlerRepository.GetHandlerOrDefaultForCData(content); b.AppendLine(handler.GetHyperLink(content)); } } return(b.ToString()); }
public string GetHtmlText(EmbeddedMessageContentHandlerRepository embeddedMessageContentHandlerRepository) { var b = new StringBuilder(); b.Append(Text); if (embeddedMessageContentHandlerRepository != null) { XCData cdata = _element.Nodes().OfType<XCData>().FirstOrDefault(); if (cdata != null) { string content = cdata.Value; var handler = embeddedMessageContentHandlerRepository.GetHandlerOrDefaultForCData(content); b.AppendLine("<div/>"); b.AppendLine(handler.GetHyperLink(content)); } } return b.ToString(); }