Braincase.GanttChart.ControlViewport.ControlViewport C# (CSharp) Метод

ControlViewport() публичный Метод

Construct a Viewport
public ControlViewport ( Control view ) : System
view System.Windows.Forms.Control
Результат System
        public ControlViewport(Control view)
        {
            _mDevice = view;
            _mhScroll = new HScrollBar();
            _mvScroll = new VScrollBar();
            _mScrollHolePatch = new UserControl();
            WorldWidth = view.Width;
            WorldHeight = view.Height;

            _mDevice.Controls.Add(_mhScroll);
            _mDevice.Controls.Add(_mvScroll);
            _mDevice.Controls.Add(_mScrollHolePatch);

            _mhScroll.Scroll += (s, e) => X = e.NewValue;
            _mvScroll.Scroll += (s, e) => Y = e.NewValue;
            _mDevice.Resize += (s, e) => this.Resize();
            _mDevice.MouseWheel += (s, e) => Y -= e.Delta > 0 ? WheelDelta : -WheelDelta;
            WheelDelta = _mvScroll.LargeChange;

            _RecalculateMatrix();
            _RecalculateRectangle();
        }