Exemplo n.º 1
0
        ///-------------------------------------------------------------------------------------------------------------
        /// <summary>
        ///    Override of Dispose so we can free our lock after DocData.
        /// </summary>
        ///-------------------------------------------------------------------------------------------------------------
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                if (_cookie != 0 && _rdt != null)
                {
                    // prevent recursion
                    uint cookie = _cookie;
                    _cookie = 0;

                    try
                    {
                        // Unlock the document, specifying to save if this is the last lock and the buffer is dirty
                        _rdt.UnlockDocument(_VSRDTFLAGS.RDT_EditLock | _VSRDTFLAGS.RDT_Unlock_SaveIfDirty, cookie);
                    }
                    finally
                    {
                        _cookie = 0;
                        _rdt    = null;
                    }
                }
                _serviceProvider = null;
            }
        }
Exemplo n.º 2
0
        private void Cleanup()
        {
            if (_docCookie != 0)
            {
                RunningDocumentTable.UnlockDocument((uint)_VSRDTFLAGS.RDT_ReadLock, _docCookie);
            }

            _docCookie = 0;
            _CurrentInvisibleEditor = null;
        }