protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { //ENTERING_SHAPE.Dispose(); //MOVING_SHAPE.Dispose(); //DRAGGING.Dispose(); //DEFAULT.Dispose(); //ZOOM_OUT.Dispose(); //ZOOM_IN.Dispose(); __selectedShapes.Clear(); __messagePipe.Dispose(); __userLayers.ForEach(l => l.Dispose()); __userLayers.Clear(); __opLayer.Clear(); __opLayer.Dispose(); } //__cur = null; __userLayers = null; __opLayer = null; __defaultLayer = null; __messagePipe = null; disposedValue = true; } }
protected bool disposedValue = false; // 要检测冗余调用 protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { __messagePipe.Dispose(); fillPattern.Dispose(); border.Dispose(); } Layer = null; __messagePipe = null; PropertyChanged = null; disposedValue = true; } }
//private void Mouse_CursorChanged(object sender, CursorChangedEventArgs e) //{ // Renderer.Render(); //} #endregion #region IDisposable Support protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { Renderer.Dispose(); __mouse.Dispose(); __bgLayer.Dispose(); __trans.Dispose(); __mp.Dispose(); } Renderer = null; __mouse = null; __bgLayer = null; __trans = null; disposedValue = true; } }