Пример #1
0
        public virtual void Dispose()
        {
            _native?.Close();
            _native?.Dispose();
            _native = null;

            _nativeControlHost?.Dispose();
            _nativeControlHost = null;

            (Screen as ScreenImpl)?.Dispose();
        }
Пример #2
0
        protected void Init(IAvnWindowBase window, IAvnScreens screens, IGlContext glContext)
        {
            _native    = window;
            _glContext = glContext;

            Handle = new MacOSTopLevelWindowHandle(window);
            if (_gpu)
            {
                _glSurface = new GlPlatformSurface(window, _glContext);
            }
            Screen             = new ScreenImpl(screens);
            _savedLogicalSize  = ClientSize;
            _savedScaling      = Scaling;
            _nativeControlHost = new NativeControlHostImpl(_native.CreateNativeControlHost());

            var monitor = Screen.AllScreens.OrderBy(x => x.PixelDensity)
                          .FirstOrDefault(m => m.Bounds.Contains(Position));

            Resize(new Size(monitor.WorkingArea.Width * 0.75d, monitor.WorkingArea.Height * 0.7d));
        }