public void Resume() { Debug.Assert(_drawingPause != null); DisposeHelper.DisposeAndNull(ref _drawingPause); _drawingEngine.Brightness = _prevBrightness; }
public void Dispose() { DisposeHelper.DisposeAndNull(ref _first); DisposeHelper.DisposeAndNull(ref _last); DisposeHelper.DisposeAndNull(ref _transition); }
public void Dispose() { _globalContext.LayoutRemoved -= OnLayoutRemoved; _drawingEngine.Brightness = 0; SetLayout(null); DisposeHelper.DisposeAndNull(ref _drawingEngine); }
void DoExit() { _trayIcon.Visible = false; DisposeHelper.DisposeAndNull(ref _coreContext); SystemEvents.SessionSwitch -= SystemEventsOnSessionSwitch; Application.Exit(); }
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"); }
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) }); }
public void ReplaceLastBitmap(BitmapRepresentation lastBitmapRepresentation) { _transition.ReplaceLastBitmap(lastBitmapRepresentation); DisposeHelper.DisposeAndNull(ref _last); _last = lastBitmapRepresentation; }
public void Dispose() { _device.KeyStateChanged += DeviceOnKeyStateChanged; DisposeHelper.DisposeAndNull(ref _device); }
public void Dispose() { DisposeHelper.DisposeAndNull(ref _visualEffectProcessor); DisposeHelper.DisposeAndNull(ref _device); }
protected override void OnLeavedLayout() { DisposeHelper.DisposeAndNull(ref _currentRepresentation); }
public void Dispose() { DisposeHelper.DisposeAndNull(ref _current); }
public void ReplaceLastBitmap(BitmapRepresentation last) { DisposeHelper.DisposeAndNull(ref _current); _current = last.Clone(); }