Exemplo n.º 1
0
		public NotesElementTreeNode(ParseIssue parseIssue)
		{
			if (object.ReferenceEquals(parseIssue, null))
				throw new ArgumentNullException("parseIssue");

			this.NodeType = NotesElementTreeNodeType.ParseIssue;
			this.NotesElement = null;
			this.ParseIssue = parseIssue;
		}
Exemplo n.º 2
0
		public NotesElementTreeNode(INotesElement notesElement)
		{
			if (object.ReferenceEquals(notesElement, null))
				throw new ArgumentNullException("notesElement");

			this.NodeType = NotesElementTreeNodeType.NotesElement;
			this.NotesElement = notesElement;
			this.ParseIssue = null;
		}
Exemplo n.º 3
0
        private void ShowIssue(ParseIssue i)
        {
            if (currentReviewDocument != null && SingleItemBrowser.CoreWebView2 != null)
            {
                int scrollTo = currentReviewDocument.NavigateToIssue(i);

                string ScrollToTopString = @"window.scrollTo(0," + scrollTo + ");";

                SingleItemBrowser.CoreWebView2.ExecuteScriptAsync(ScrollToTopString);
            }
        }
Exemplo n.º 4
0
		/// <summary>
		/// Colorize TextView buffer range corresponding to a <see cref="ParseIssue"/>.
		/// </summary>
		/// <param name="issue">The parse issue.</param>
		protected void ColorizeParseIssue(ParseIssue issue)
		{
			if (object.ReferenceEquals(issue, null))
				throw new ArgumentNullException("issue");

			Location loc = issue.Location;
			if (object.ReferenceEquals(loc, null) || loc.StartLine < 1)
				// No location information known; ignore.
				return;

			TextBuffer buf = this.textviewText.Buffer;
			TextIter start, end;
			TextTag tag;
			if (loc.StartCharacter < 1 && loc.EndCharacter < 1) {
				// Line-wise
				start = buf.GetIterAtLineOffset(loc.StartLine - 1, 0);
				end = buf.GetIterAtLineOffset(loc.EndLine - 1 + 1, 0);
				switch (issue.Severity) {
				case ParseIssueSeverity.Error:
					tag = _TagErrorParseIssueLinewise;
					break;
				case ParseIssueSeverity.Warning:
					tag = _TagWarningParseIssueLinewise;
					break;
				default:
					Debug.Print("[MainWindow] ColorizeParseIssue(): " +
						"Unrecognized severity \"{0}\" line-wise, skipping.",
						issue.Severity);
					return;
				}
			}
			else {
				// Character-wise
				start = buf.GetIterAtLineOffset(loc.StartLine - 1, loc.StartCharacter - 1);
				end = buf.GetIterAtLineOffset(loc.EndLine - 1, loc.EndCharacter - 1);
				switch (issue.Severity) {
				case ParseIssueSeverity.Error:
					tag = _TagErrorParseIssue;
					break;
				case ParseIssueSeverity.Warning:
					tag = _TagWarningParseIssue;
					break;
				default:
					Debug.Print("[MainWindow] ColorizeParseIssue(): " +
						"Unrecognized severity \"{0}\" character-wise, skipping.",
						issue.Severity);
					return;
				}
			}
			buf.ApplyTag(tag, start, end);
		}