static public void StaticUpdateUI(PlayerSmallData _data) { if (Manager.Instance.OpenedBy() != _data) { if (_data.ButtonPlayPause != null) { _data.ButtonPlayPause.Image = PlayIcon; _data.ButtonPlayPause.Enabled = Manager.Instance.canOpen(_data, _data.File); _data.ButtonPlayPause.Visible = true; } if (_data.ButtonStop != null) { _data.ButtonStop.Enabled = false; _data.ButtonStop.Visible = false; } } else { if (_data.ButtonPlayPause != null) { _data.ButtonPlayPause.Visible = true; if (Manager.Instance.IsPlaying()) { _data.ButtonPlayPause.Image = PauseIcon; } else { _data.ButtonPlayPause.Image = PlayIcon; } } if (_data.ButtonStop != null) { _data.ButtonStop.Enabled = true; _data.ButtonStop.Visible = true; } } //InvalidateEx(); }
//--------------------------------------------------------------------------------------- public static void StaticPaint(Graphics _graphics, Rectangle R, Point _mousePos, PlayerSmallData _data, PlayerSmallDisplayParams _params = null) { if (_data == null) { return; } SmoothingMode saveMode = _graphics.SmoothingMode; _graphics.SmoothingMode = SmoothingMode.HighQuality; if (_data.ButtonPlayPause != null) { if (_data.ButtonPlayPause.MouseHover && !_data.ButtonPlayPause.Rect.Contains(_mousePos)) { _data.ButtonPlayPause.MouseHover = false; } _data.ButtonPlayPause.Paint(_graphics, ref R, _params); } if (_data.ButtonStop != null) { if (_data.ButtonStop.MouseHover && !_data.ButtonStop.Rect.Contains(_mousePos)) { _data.ButtonStop.MouseHover = false; } _data.ButtonStop.Paint(_graphics, ref R, _params); } _graphics.SmoothingMode = saveMode; }