public void Dispose() { if (ActiveView == this) { ActiveView = null; } if (this.MainCanvas != null) { this.MainCanvas.clean(); this.MainCanvas = null; } if (this.TempCanvas != null) { this.TempCanvas.clean(); this.TempCanvas = null; } if (_view != null) { this.CoreView.destoryView(_view); _view.Dispose(); _view = null; } if (this.CoreView != null) { this.CoreView.Dispose(); this.CoreView = null; } WPFImageSourceHelper.Clean(); }
private WPFImageSourceHelper() { _actionImageDict = new Dictionary <int, ImageSource>(); AddActionImage(MgContextAction.kMgActionSelAll, Resource1.vg_selall); AddActionImage(MgContextAction.kMgActionCancel, Resource1.vg_back); AddActionImage(MgContextAction.kMgActionDelete, Resource1.vg_delete); AddActionImage(MgContextAction.kMgActionClone, Resource1.vg_clone); AddActionImage(MgContextAction.kMgActionFixedLength, Resource1.vg_fixlen); AddActionImage(MgContextAction.kMgActionFreeLength, Resource1.vg_freelen); AddActionImage(MgContextAction.kMgActionLocked, Resource1.vg_lock); AddActionImage(MgContextAction.kMgActionUnlocked, Resource1.vg_unlock); AddActionImage(MgContextAction.kMgActionEditVertex, Resource1.vg_edit); AddActionImage(MgContextAction.kMgActionHideVertex, Resource1.vg_back); AddActionImage(MgContextAction.kMgActionGroup, Resource1.vg_group); AddActionImage(MgContextAction.kMgActionUngroup, Resource1.vg_ungroup); AddActionImage(MgContextAction.kMgActionOverturn, Resource1.vg_overturn); _handleImages = new ImageSource[16]; // GiHandleTypes _handleImages[0] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgdot1); _handleImages[1] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgdot2); _handleImages[2] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgdot3); _handleImages[3] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_lock); _handleImages[4] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_unlock); _handleImages[5] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_back); _handleImages[6] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_endedit); _handleImages[7] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgnode); _handleImages[8] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgcen); _handleImages[9] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgmid); _handleImages[10] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgquad); _handleImages[11] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgtangent); _handleImages[12] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgcross); _handleImages[13] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgnear); _handleImages[14] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgpivot); _handleImages[15] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_overturn); }
public WPFImageSourceHelper() { _actionImageDict = new Dictionary<int, ImageSource>(); AddActionImage(1, Resource1.vg_selall); AddActionImage(3, Resource1.vg_draw); AddActionImage(4, Resource1.vg_back); AddActionImage(5, Resource1.vg_delete); AddActionImage(6, Resource1.vg_clone); AddActionImage(7, Resource1.vg_fixlen); AddActionImage(8, Resource1.vg_freelen); AddActionImage(9, Resource1.vg_lock); AddActionImage(10, Resource1.vg_unlock); AddActionImage(11, Resource1.vg_edit); AddActionImage(12, Resource1.vg_back); AddActionImage(15, Resource1.vg_addvertex); AddActionImage(16, Resource1.vg_delvertex); AddActionImage(17, Resource1.vg_group); AddActionImage(18, Resource1.vg_ungroup); AddActionImage(19, Resource1.vg_overturn); //AddActionImage(40, Resource1.vg_break); _handleImages = new ImageSource[7]; _handleImages[0] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgdot1); _handleImages[1] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgdot2); _handleImages[2] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vgdot3); _handleImages[3] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_lock); _handleImages[4] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_unlock); _handleImages[5] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_back); _handleImages[6] = WPFImageSourceHelper.BitmapToImageSource(Resource1.vg_endedit); }
/// <summary> /// 释放静态资源 /// </summary> public static void Clean() { Instance.Dispose(); Instance = null; }
/// <summary> /// 释放静态资源 /// </summary> public static void Clean() { Instance.Dispose(); Instance = null; }