public ScreenControl(OSDScreen screen, IItemCaptionProvider captionProvider) { this.screen = screen ?? throw new ArgumentNullException(nameof(screen)); this.captionProvider = captionProvider; InitializeComponent(); layoutControl.ScreenControl = this; layoutControl.Items = screen.Items; layoutControl.Visualizer = new Visualizer(captionProvider); cbReducedView.CheckedChanged += (s, e) => SetViewSize(); cbUseNameCaptions.CheckedChanged += (s, e) => SetCaptionMode(); btnClearAll.Click += (s, e) => { foreach (var i in screen.Items) { i.Enabled.Value = 0; } }; btnCopy.Click += (s, e) => { if (screen.Items.Any()) { ScreenToCopy = screen; } }; btnPaste.Click += (s, e) => { if (screen.Items.Any() && ScreenToCopy != null) { ScreenToCopy.CopyTo(screen); } }; SetViewSize(); }
public Visualizer(IItemCaptionProvider captionProvider) { if (font == null) { font = MakeFont(Resources.clarity, 16, 16, 1); } this.captionProvider = captionProvider; }