Esempio n. 1
0
        public void Resume()
        {
            Debug.Assert(_drawingPause != null);

            DisposeHelper.DisposeAndNull(ref _drawingPause);
            _drawingEngine.Brightness = _prevBrightness;
        }
Esempio n. 2
0
        public void Dispose()
        {
            DisposeHelper.DisposeAndNull(ref _first);
            DisposeHelper.DisposeAndNull(ref _last);

            DisposeHelper.DisposeAndNull(ref _transition);
        }
Esempio n. 3
0
        public void Dispose()
        {
            _globalContext.LayoutRemoved -= OnLayoutRemoved;

            _drawingEngine.Brightness = 0;
            SetLayout(null);
            DisposeHelper.DisposeAndNull(ref _drawingEngine);
        }
Esempio n. 4
0
        void DoExit()
        {
            _trayIcon.Visible = false;

            DisposeHelper.DisposeAndNull(ref _coreContext);

            SystemEvents.SessionSwitch -= SystemEventsOnSessionSwitch;

            Application.Exit();
        }
Esempio n. 5
0
        public void TestDisposeHelper()
        {
            Test test     = new Test();
            Test testCopy = test;

            Assert.AreEqual(false, test.Disposed, "Object already disposed");

            DisposeHelper.DisposeAndNull(ref test);

            Assert.AreEqual(true, testCopy.Disposed, "Object not disposed");
            Assert.AreEqual(null, test, "Object not cleared");
        }
Esempio n. 6
0
        private void OnDrawLayout(object sender, DrawEventArgs e)
        {
            BitmapEx currentBitmap;

            lock (_bitmapLock)
            {
                currentBitmap = _currentRepresentation.CreateBitmap();
                foreach (var element in e.Elements)
                {
                    var destRect = new Rectangle(_buttonShift.Width + element.Location.X * _individualButtonSize.Width, _buttonShift.Height + element.Location.Y * _individualButtonSize.Height, _individualButtonSize.Width, _individualButtonSize.Height);
                    using (var sourceBitmap = element.BitmapRepresentation.CreateBitmap())
                    {
                        BitmapHelpers.ResizeBitmap(sourceBitmap, currentBitmap, destRect);
                        element.BitmapRepresentation.Dispose();
                    }
                }

                DisposeHelper.DisposeAndNull(ref _currentRepresentation);
                _currentRepresentation = new BitmapRepresentation(currentBitmap);
            }

            DrawInvoke(new[] { new LayoutDrawElement(new Location(0, 0), currentBitmap) });
        }
Esempio n. 7
0
 public void ReplaceLastBitmap(BitmapRepresentation lastBitmapRepresentation)
 {
     _transition.ReplaceLastBitmap(lastBitmapRepresentation);
     DisposeHelper.DisposeAndNull(ref _last);
     _last = lastBitmapRepresentation;
 }
Esempio n. 8
0
 public void Dispose()
 {
     _device.KeyStateChanged += DeviceOnKeyStateChanged;
     DisposeHelper.DisposeAndNull(ref _device);
 }
Esempio n. 9
0
 public void Dispose()
 {
     DisposeHelper.DisposeAndNull(ref _visualEffectProcessor);
     DisposeHelper.DisposeAndNull(ref _device);
 }
Esempio n. 10
0
 protected override void OnLeavedLayout()
 {
     DisposeHelper.DisposeAndNull(ref _currentRepresentation);
 }
Esempio n. 11
0
 public void Dispose()
 {
     DisposeHelper.DisposeAndNull(ref _current);
 }
Esempio n. 12
0
 public void ReplaceLastBitmap(BitmapRepresentation last)
 {
     DisposeHelper.DisposeAndNull(ref _current);
     _current = last.Clone();
 }