Пример #1
0
        public override void CloseIfAllViewsClosed()
        {
            if (registeredViews.Count == 0)
            {
                bool wasDirty = this.IsDirty;
                FileService.OpenedFileClosed(this);

                FileClosed.RaiseEvent(this, EventArgs.Empty);

                if (fileChangeWatcher != null)
                {
                    fileChangeWatcher.Dispose();
                    fileChangeWatcher = null;
                }

                if (wasDirty)
                {
                    // We discarded some information when closing the file,
                    // so we need to re-parse it.
                    if (System.IO.File.Exists(this.FileName))
                    {
                        ParserService.BeginParse(this.FileName);
                    }
                    else
                    {
                        ParserService.ClearParseInformation(this.FileName);
                    }
                }
            }
        }
Пример #2
0
        public override void CloseIfAllViewsClosed()
        {
            if (registeredViews.Count == 0)
            {
                bool wasDirty = this.IsDirty;
                FileService.OpenedFileClosed(this);

                FileClosed.RaiseEvent(this, EventArgs.Empty);

                if (fileChangeWatcher != null)
                {
                    fileChangeWatcher.Dispose();
                    fileChangeWatcher = null;
                }

                if (wasDirty)
                {
                    // We discarded some information when closing the file,
                    // so we need to re-parse it.
                }
            }
        }