示例#1
0
        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));
        }
示例#2
0
            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);
                }
            }
示例#3
0
        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();
        }
示例#4
0
 public BarPlugin(BarPluginConfig config)
 {
     _config = config;
 }
示例#5
0
 public BarPlugin()
 {
     _config = new BarPluginConfig();
 }