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

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

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

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

            DisposeHelper.DisposeAndNull(ref _coreContext);

            SystemEvents.SessionSwitch -= SystemEventsOnSessionSwitch;

            Application.Exit();
        }
Exemple #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");
        }
Exemple #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) });
        }
Exemple #7
0
 public void ReplaceLastBitmap(BitmapRepresentation lastBitmapRepresentation)
 {
     _transition.ReplaceLastBitmap(lastBitmapRepresentation);
     DisposeHelper.DisposeAndNull(ref _last);
     _last = lastBitmapRepresentation;
 }
Exemple #8
0
 public void Dispose()
 {
     _device.KeyStateChanged += DeviceOnKeyStateChanged;
     DisposeHelper.DisposeAndNull(ref _device);
 }
Exemple #9
0
 public void Dispose()
 {
     DisposeHelper.DisposeAndNull(ref _visualEffectProcessor);
     DisposeHelper.DisposeAndNull(ref _device);
 }
Exemple #10
0
 protected override void OnLeavedLayout()
 {
     DisposeHelper.DisposeAndNull(ref _currentRepresentation);
 }
Exemple #11
0
 public void Dispose()
 {
     DisposeHelper.DisposeAndNull(ref _current);
 }
Exemple #12
0
 public void ReplaceLastBitmap(BitmapRepresentation last)
 {
     DisposeHelper.DisposeAndNull(ref _current);
     _current = last.Clone();
 }