File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,13 +197,22 @@ private void LoadThemes()
197197 {
198198 cboThemeSelect . Items . Add ( theme ) ;
199199 }
200-
201- _themesWatcher = new FileSystemWatcher ( _dictionaryManager . GetThemeInstallDir ( ) ) ;
202- _themesWatcher . Created += ThemesWatcher_Created ;
203- _themesWatcher . Deleted += ThemesWatcher_Deleted ;
204- _themesWatcher . Renamed += ThemesWatcher_Renamed ;
205- _themesWatcher . Filter = "*.xaml" ;
206- _themesWatcher . EnableRaisingEvents = true ;
200+ try
201+ {
202+ string path = _dictionaryManager . GetThemeInstallDir ( ) ;
203+ Directory . CreateDirectory ( path ) ;
204+
205+ _themesWatcher = new FileSystemWatcher ( _dictionaryManager . GetThemeInstallDir ( ) ) ;
206+ _themesWatcher . Created += ThemesWatcher_Created ;
207+ _themesWatcher . Deleted += ThemesWatcher_Deleted ;
208+ _themesWatcher . Renamed += ThemesWatcher_Renamed ;
209+ _themesWatcher . Filter = "*.xaml" ;
210+ _themesWatcher . EnableRaisingEvents = true ;
211+ }
212+ catch ( Exception e )
213+ {
214+ ShellLogger . Warning ( $ "Unable to watch custom themes directory: { e } ") ;
215+ }
207216 }
208217
209218 private void ThemesWatcher_Created ( object sender , FileSystemEventArgs e )
You can’t perform that action at this time.
0 commit comments