Beispiel #1
0
        /// <summary>Function to provide clean up for the plugin.</summary>
        protected override void OnShutdown()
        {
            try
            {
                if (_settings != null)
                {
                    // Persist any settings.
                    ContentPlugInService.WriteContentSettings(typeof(SpriteEditorPlugIn).FullName, _settings, new JsonSharpDxRectConverter());
                }
            }
            catch (Exception ex)
            {
                // We don't care if it crashes. The worst thing that'll happen is your settings won't persist.
                CommonServices.Log.LogException(ex);
            }

            _rtv?.Dispose();
            _bgPattern?.Dispose();
            _noImage?.Dispose();

            ViewFactory.Unregister <ISpriteContent>();

            base.OnShutdown();
        }