Meta.MetaPackage.Dispose C# (CSharp) Method

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            // Unadvise all events
            if(vsShell != null && shellPropertyChangesCookie != 0)
                vsShell.UnadviseShellPropertyChanges(shellPropertyChangesCookie);

            if(sbm != null && updateSolutionEventsCookie != 0)
                sbm.UnadviseUpdateSolutionEvents(updateSolutionEventsCookie);

            if(solution != null && solutionEventsCookie != 0)
                solution.UnadviseSolutionEvents(solutionEventsCookie);

            BuildManager.DefaultBuildManager.CancelAllSubmissions();

            if (!_disposed)
            {
                if (disposing)
                {
                    if( buildProfiler != null )
                        buildProfiler.Dispose();
                    if( templateProfiler != null )
                        templateProfiler.Dispose();
                }

                // Indicate that the instance has been disposed.
                _disposed = true;
            }
        }

Same methods

MetaPackage::Dispose ( ) : void