public static void AddBar(this IConfigContext context, BarPluginConfig config = null) { config = config ?? new BarPluginConfig(); context.AddLayoutProxy((layout) => new MenuBarLayoutEngine(layout, config.BarTitle, config.BarHeight)); context.Plugins.RegisterPlugin(new BarPlugin(config)); }
public MyAppContext(BarPluginConfig config, IConfigContext context) { var bars = new List <BarForm>(); foreach (var m in context.MonitorContainer.GetAllMonitors()) { var bar = new BarForm(m, config); var left = config.LeftWidgets(); var right = config.RightWidgets(); bar.Initialize(left, right, context); bar.Show(); bars.Add(bar); } }
public BarForm(IMonitor monitor, BarPluginConfig config) { _monitor = monitor; _config = config; _timer = new System.Timers.Timer(50); _timer.Elapsed += Redraw; this.Text = config.BarTitle; this.ControlBox = false; this.FormBorderStyle = FormBorderStyle.None; this.BackColor = ColorToColor(config.DefaultWidgetBackground); this.Load += OnLoad; InitializeComponent(); }
public BarPlugin(BarPluginConfig config) { _config = config; }
public BarPlugin() { _config = new BarPluginConfig(); }