public Deskband() { try { if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } Application.EnableVisualStyles(); // Application.SetCompatibleTextRenderingDefault(false); Options opt = TaskbarMonitor.Options.ReadFromDisk(); var ctl = new SystemWatcherControl(opt); Options.MinHorizontalSize = new Size((ctl.Options.HistorySize + 10) * ctl.CountersCount, 30); ctl.OnChangeSize += Ctl_OnChangeSize; _control = ctl; } catch (Exception ex) { MessageBox.Show($"Error intializing Deskband: {ex.Message}", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public OptionForm(Options opt, GraphTheme theme, Version version, SystemWatcherControl originalControl) { this.Version = version; this.Theme = new GraphTheme(); this.OriginalTheme = theme; theme.CopyTo(this.Theme); this.Options = new Options(); this.OriginalOptions = opt; opt.CopyTo(this.Options); this.originalControl = originalControl; AvailableGraphTypes = new Dictionary <string, IList <Counters.ICounter.CounterType> > { { "CPU", new List <TaskbarMonitor.Counters.ICounter.CounterType> { TaskbarMonitor.Counters.ICounter.CounterType.SINGLE, TaskbarMonitor.Counters.ICounter.CounterType.STACKED } }, { "MEM", new List <TaskbarMonitor.Counters.ICounter.CounterType> { TaskbarMonitor.Counters.ICounter.CounterType.SINGLE } }, { "DISK", new List <TaskbarMonitor.Counters.ICounter.CounterType> { TaskbarMonitor.Counters.ICounter.CounterType.SINGLE, TaskbarMonitor.Counters.ICounter.CounterType.STACKED, TaskbarMonitor.Counters.ICounter.CounterType.MIRRORED } }, { "NET", new List <TaskbarMonitor.Counters.ICounter.CounterType> { TaskbarMonitor.Counters.ICounter.CounterType.SINGLE, TaskbarMonitor.Counters.ICounter.CounterType.STACKED, TaskbarMonitor.Counters.ICounter.CounterType.MIRRORED } } }; InitializeComponent(); /* * float dpiX, dpiY; * using (Graphics graphics = this.CreateGraphics()) * { * dpiX = graphics.DpiX; * dpiY = graphics.DpiY; * } * * if (dpiX >= 96) * { * var fontSize = 7.25f; * this.Font = new Font("Calibri", fontSize, FontStyle.Regular); * } */ Initialize(); }
public Deskband() { Options opt = TaskbarMonitor.Options.ReadFromDisk(); var ctl = new SystemWatcherControl(opt); Options.MinHorizontalSize = new Size((ctl.Options.HistorySize + 10) * ctl.CountersCount, 30); ctl.OnChangeSize += Ctl_OnChangeSize; _control = ctl; }
public Deskband() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Options opt = TaskbarMonitor.Options.ReadFromDisk(); GraphTheme theme = GraphTheme.ReadFromDisk(); var ctl = new SystemWatcherControl(opt, theme); Options.MinHorizontalSize = new Size((ctl.Options.HistorySize + 10) * ctl.CountersCount, 30); ctl.OnChangeSize += Ctl_OnChangeSize; _control = ctl; }