コード例 #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 (File.Exists(this.FileName))
                    {
                        ParserService.BeginParse(this.FileName);
                    }
                    else
                    {
                        ParserService.ClearParseInformation(this.FileName);
                    }
                }
            }
        }
コード例 #2
0
ファイル: OpenedFile.cs プロジェクト: vu111293/pat-design
        public override void CloseIfAllViewsClosed()
        {
            if (registeredViews.Count == 0)
            {
                FileService.OpenedFileClosed(this);

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