Пример #1
0
		public IEnumerable<CreatedMenuItem> Create(IMenuItemContext context) {
			foreach (var theme in themeService.VisibleThemes) {
				var attr = new ExportMenuItemAttribute { Header = theme.GetMenuName() };
				var tmp = theme;
				var item = new MyMenuItem(ctx => themeService.Theme = tmp, theme == themeService.Theme);
				yield return new CreatedMenuItem(attr, item);
			}
		}
Пример #2
0
 public IEnumerable<CreatedMenuItem> Create(IMenuItemContext context)
 {
     foreach (var theme in themeManager.AllThemesSorted) {
         if (!themeManager.Settings.ShowAllThemes && !themeManager.IsHighContrast && theme.IsHighContrast)
             continue;
         var attr = new ExportMenuItemAttribute { Header = GetThemeHeaderName(theme) };
         var tmp = theme;
         var item = new MyMenuItem(ctx => themeManager.Theme = tmp, theme == themeManager.Theme);
         yield return new CreatedMenuItem(attr, item);
     }
 }