Example #1
0
 private void InitializeWidgets(IEnumerable <IBarWidget> widgets, IBarWidgetContext context)
 {
     foreach (var w in widgets)
     {
         w.Initialize(context);
     }
 }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
 public void Initialize(IBarWidgetContext context)
 {
     Context = context;
     Initialize();
 }