public void AttachTextView(string path, ITextView textView)
        {
            SourceFileData data = this.FindSourceFile(path, false);

            data.AttachTextView(textView);
            data.ViewClosed += SourceFileData_ViewClosed;
        }
 public void AddSourceFiles(IEnumerable <string> files)
 {
     foreach (string file in files)
     {
         SourceFileData data = new SourceFileData(this, file);
         this.files.Add(data);
     }
 }
        public CompilerMessageTagger(ITextView textView, string fullPath)
            : base(textView.TextBuffer)
        {
            this.textView = textView;
            this.FileName = fullPath;

            this.sourceFileData = SourceFileCompiler.Instance.FindSourceFileData(fullPath);

            this.sourceFileData.SourceFileSet.SetClosed       += SourceFileSet_SetClosed;
            this.sourceFileData.SourceFileSet.CompileComplete += SourceFileSet_CompileComplete;
        }
        private SourceFileData FindSourceFile(string file, bool createIfMissing)
        {
            SourceFileData data = this.files.FirstOrDefault(d => string.Equals(d.Path, file, StringComparison.OrdinalIgnoreCase));

            if (data == null && createIfMissing)
            {
                data = new SourceFileData(this, file);
                this.files.Add(data);
            }

            return(data);
        }
        void SourceFileData_ViewClosed(object sender, EventArgs e)
        {
            SourceFileData data = sender as SourceFileData;

            data.ViewClosed -= SourceFileData_ViewClosed;

            // If there are no more source files with views, we can kill the entire set.
            if (this.files.All(d => d.TextView == null))
            {
                this.files.Clear();
                ////this.Items.Clear();
                this.messages.Clear();

                this.OnSetClosed();
            }
        }