@@ -70,6 +70,7 @@ public class ParserListener : IxCoreColleague, IDisposable, IVwNotifyChange
7070 private string m_sourceText = null ;
7171 private ObservableCollection < ParserReportViewModel > m_parserReports = null ;
7272 private ParserReportsDialog m_parserReportsDialog = null ;
73+ private IList < ParserReportDialog > m_parserReportDialogs = new List < ParserReportDialog > ( ) ;
7374 private string m_defaultComment = null ;
7475
7576 public void Init ( Mediator mediator , PropertyTable propertyTable , XmlNode configurationParameters )
@@ -85,6 +86,7 @@ public void Init(Mediator mediator, PropertyTable propertyTable, XmlNode configu
8586 m_sda . AddNotification ( this ) ;
8687
8788 Subscriber . Subscribe ( EventConstants . StopParser , StopParser ) ;
89+ Subscriber . Subscribe ( EventConstants . RefreshPopupWindowFonts , RefreshPopupWindowFonts ) ;
8890 }
8991
9092 /// <summary>
@@ -364,6 +366,7 @@ protected virtual void Dispose(bool disposing)
364366 if ( disposing )
365367 {
366368 Subscriber . Unsubscribe ( EventConstants . StopParser , StopParser ) ;
369+ Subscriber . Unsubscribe ( EventConstants . RefreshPopupWindowFonts , RefreshPopupWindowFonts ) ;
367370
368371 // other clients may now parse
369372 // Dispose managed resources here.
@@ -626,7 +629,7 @@ private void UpdateWordforms(IEnumerable<IWfiWordform> wordforms, ParserPriority
626629 // Write an empty parser report.
627630 var parserReport = CreateParserReport ( ) ;
628631 ParserReportViewModel viewModel = AddParserReport ( parserReport ) ;
629- ShowParserReport ( viewModel , m_mediator , m_cache ) ;
632+ ShowParserReport ( viewModel ) ;
630633 }
631634 }
632635 m_parserConnection . UpdateWordforms ( wordforms , priority , checkParser ) ;
@@ -681,7 +684,7 @@ private void WordformUpdatedEventHandler(object sender, WordformUpdatedEventArgs
681684 // Convert parse results into ParserReport.
682685 var parserReport = CreateParserReport ( ) ;
683686 ParserReportViewModel viewModel = AddParserReport ( parserReport ) ;
684- ShowParserReport ( viewModel , m_mediator , m_cache ) ;
687+ ShowParserReport ( viewModel ) ;
685688 }
686689 }
687690
@@ -839,13 +842,25 @@ public void ShowParserReports()
839842 {
840843 ReadParserReports ( ) ;
841844 // Create parser reports window.
842- m_parserReportsDialog = new ParserReportsDialog ( m_parserReports , m_mediator , m_cache , m_defaultComment ) ;
845+ m_parserReportsDialog = new ParserReportsDialog ( m_parserReports , this , m_mediator , m_cache , m_propertyTable , m_defaultComment ) ;
843846 m_parserReportsDialog . Closed += ParserReportsDialog_Closed ;
844847 }
845848 m_parserReportsDialog . Show ( ) ; // Show the dialog but do not block other app access
846849 m_parserReportsDialog . BringIntoView ( ) ;
847850 }
848851
852+ public void RefreshPopupWindowFonts ( object sender )
853+ {
854+ if ( m_parserReportsDialog != null )
855+ {
856+ m_parserReportsDialog . SetFont ( ) ;
857+ }
858+ foreach ( ParserReportDialog dialog in m_parserReportDialogs )
859+ {
860+ dialog . SetFont ( ) ;
861+ }
862+ }
863+
849864 private void ParserReportsDialog_Closed ( object sender , EventArgs e )
850865 {
851866 ParserReportsDialog dialog = ( ParserReportsDialog ) sender ;
@@ -888,12 +903,22 @@ private ParserReportViewModel AddParserReport(ParserReport parserReport)
888903 /// <summary>
889904 /// Display a parser report window.
890905 /// </summary>
891- /// <param name="parserReport"></param>
892- /// <param name="mediator">the mediator is used to call TryAWord</param>
893- public static void ShowParserReport ( ParserReportViewModel parserReport , Mediator mediator , LcmCache cache )
906+ public void ShowParserReport ( object obj )
894907 {
895- ParserReportDialog dialog = new ParserReportDialog ( parserReport , mediator , cache ) ;
908+ ParserReportViewModel parserReport = obj as ParserReportViewModel ;
909+ ParserReportDialog dialog = new ParserReportDialog ( parserReport , m_mediator , m_cache , m_propertyTable ) ;
896910 dialog . Show ( ) ;
911+ m_parserReportDialogs . Add ( dialog ) ;
912+ dialog . Closed += ParserReportDialog_Closed ;
913+ }
914+
915+ private void ParserReportDialog_Closed ( object sender , EventArgs e )
916+ {
917+ ParserReportDialog dialog = ( ParserReportDialog ) sender ;
918+ if ( dialog != null )
919+ {
920+ m_parserReportDialogs . Remove ( dialog ) ;
921+ }
897922 }
898923
899924 public bool OnParseAllWords ( object argument )
0 commit comments