private void InitializeWidgets(IEnumerable <IBarWidget> widgets, IBarWidgetContext context) { foreach (var w in widgets) { w.Initialize(context); } }
public BarSection(bool reverse, FlowLayoutPanel panel, IBarWidget[] widgets, IMonitor monitor, IConfigContext context, Color defaultFore, Color defaultBack, int fontSize) { _panel = panel; _widgets = widgets; _monitor = monitor; _configContext = context; _fontSize = fontSize; _dirty = true; _reverse = reverse; _defaultFore = defaultFore; _defaultBack = defaultBack; _clickedHandlers = new Dictionary <Label, Action>(); _context = new BarWidgetContext(this, _monitor, _configContext); InitializeWidgets(widgets, _context); }
public BarSection(bool reverse, FlowLayoutPanel panel, IBarWidget[] widgets, IMonitor monitor, IConfigContext context, Color defaultFore, Color defaultBack, string fontName, int fontSize) { _panel = panel; _widgets = widgets; _monitor = monitor; _configContext = context; _fontName = fontName; _fontSize = fontSize; _reverse = reverse; _defaultFore = defaultFore; _defaultBack = defaultBack; _clickedHandlers = new Dictionary <Label, Action>(); _context = new BarWidgetContext(this, _monitor, _configContext); while (_panel.Controls.Count != _widgets.Count()) { _panel.Controls.Add(CreateWidgetPanel()); } InitializeWidgets(widgets, _context); }
public void Initialize(IBarWidgetContext context) { Context = context; Initialize(); }