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

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

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

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

            DisposeHelper.DisposeAndNull(ref _coreContext);

            SystemEvents.SessionSwitch -= SystemEventsOnSessionSwitch;

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