Beispiel #1
0
        private bool IsRelevant(ErrorListChangeEventArgs e)
        {
            switch (e.Action)
            {
            case ErrorListAction.ClearFile:
            case ErrorListAction.AddFile:
                return(e.ContainsFile(this.fileName));

            case ErrorListAction.ClearAll:
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        private void OnErrorListChange(object sender, ErrorListChangeEventArgs e)
        {
            if (this.IsRelevant(e))
            {
                this.PopulateTags();

                var handler = this.TagsChanged;

                if (handler != null)
                {
                    var snapshot = this.buffer.CurrentSnapshot;
                    var span     = new SnapshotSpan(snapshot, new Span(0, snapshot.Length));

                    handler(this, new SnapshotSpanEventArgs(span));
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Wrapper that suspends error list refreshes for the duration of the batch function.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="fileNames">Names of the files.</param>
        /// <param name="batch">The batch.</param>
        private void BatchAction(ErrorListAction action, IEnumerable <string> fileNames, Action batch)
        {
            this.SuspendRefresh();

            try
            {
                batch();

                var handler = this.ErrorListChange;

                if (handler != null)
                {
                    var e = new ErrorListChangeEventArgs(action, fileNames);

                    handler(this, e);
                }
            }
            finally
            {
                this.ResumeRefresh();
            }
        }
        /// <summary>
        /// Wrapper that suspends error list refreshes for the duration of the batch function.
        /// </summary>
        /// <param name="action">The action.</param>
        /// <param name="fileNames">Names of the files.</param>
        /// <param name="batch">The batch.</param>
        private void BatchAction(ErrorListAction action, IEnumerable<string> fileNames, Action batch)
        {
            this.SuspendRefresh();

            try
            {
                batch();

                var handler = this.ErrorListChange;

                if (handler != null)
                {
                    var e = new ErrorListChangeEventArgs(action, fileNames);

                    handler(this, e);
                }
            }
            finally
            {
                this.ResumeRefresh();
            }
        }