void AddIssue(ProjectFile file, BaseCodeIssueProvider provider, CodeIssue r)
        {
            var topLevelProvider = (provider as CodeIssueProvider) ?? provider.Parent;

            if (topLevelProvider == null)
            {
                throw new ArgumentException("must be a CodeIssueProvider or a BaseCodeIssueProvider with Parent != null", "provider");
            }
            var issue = new IssueSummary {
                IssueDescription    = r.Description,
                Region              = r.Region,
                ProviderTitle       = topLevelProvider.Title,
                ProviderDescription = topLevelProvider.Description,
                ProviderCategory    = topLevelProvider.Category,
                Severity            = topLevelProvider.GetSeverity(),
                File              = file,
                Project           = file.Project,
                InspectorIdString = r.InspectorIdString
            };

            issue.Actions = r.Actions.Select(a => new ActionSummary {
                Batchable    = a.SupportsBatchRunning,
                SiblingKey   = a.SiblingKey,
                Title        = a.Title,
                Region       = a.DocumentRegion,
                IssueSummary = issue
            }).ToList();
            IssueSink.AddIssue(issue);
        }
Example #2
0
        public static IssueSummary FromCodeIssue(ProjectFile file, BaseCodeIssueProvider provider, CodeIssue codeIssue)
        {
            var topLevelProvider = (provider as CodeIssueProvider) ?? provider.Parent;

            if (topLevelProvider == null)
            {
                throw new ArgumentException("must be a CodeIssueProvider or a BaseCodeIssueProvider with Parent != null", "provider");
            }
            var issueSummary = new IssueSummary {
                IssueDescription    = codeIssue.Description,
                Region              = codeIssue.Region,
                ProviderTitle       = topLevelProvider.Title,
                ProviderDescription = topLevelProvider.Description,
                ProviderCategory    = topLevelProvider.Category,
                Severity            = topLevelProvider.GetSeverity(),
                IssueMarker         = codeIssue.IssueMarker,
                File              = file,
                Project           = file.Project,
                InspectorIdString = codeIssue.InspectorIdString
            };

            issueSummary.Actions = codeIssue.Actions.Select(a => new ActionSummary {
//				Batchable = a.SupportsBatchRunning,
//				SiblingKey = a.SiblingKey,
//				Title = a.,
//				Region = a.DocumentRegion,
                IssueSummary = issueSummary
            }).ToList();
            return(issueSummary);
        }
Example #3
0
		public static IssueSummary FromCodeIssue(ProjectFile file, BaseCodeIssueProvider provider, CodeIssue codeIssue)
		{
			var topLevelProvider = (provider as CodeIssueProvider) ?? provider.Parent;
			if (topLevelProvider == null)
				throw new ArgumentException ("must be a CodeIssueProvider or a BaseCodeIssueProvider with Parent != null", "provider");
			var issueSummary = new IssueSummary {
				IssueDescription = codeIssue.Description,
				Region = codeIssue.Region,
				ProviderTitle = topLevelProvider.Title,
				ProviderDescription = topLevelProvider.Description,
				ProviderCategory = topLevelProvider.Category,
				Severity = topLevelProvider.GetSeverity (),
				IssueMarker = codeIssue.IssueMarker,
				File = file,
				Project = file.Project,
				InspectorIdString = codeIssue.InspectorIdString
			};
			issueSummary.Actions = codeIssue.Actions.Select (a => new ActionSummary {
				Batchable = a.SupportsBatchRunning,
				SiblingKey = a.SiblingKey,
				Title = a.Title,
				Region = a.DocumentRegion,
				IssueSummary = issueSummary
			}).ToList ();
			return issueSummary;
		}
		public CodeIssueOptionsDialog (BaseCodeIssueProvider inpector)
		{
			this.inpector = inpector;
			Build ();
			HasSeparator = false;

			labelInspectionTitle.Text = inpector.Title;
			var s = inpector.GetSeverity ();
			radiobuttonHide.Active = s == Severity.None;
			radiobuttonError.Active = s == Severity.Error;
			radiobuttonWarning.Active = s == Severity.Warning;
			radiobuttonHint.Active = s == Severity.Hint;
			radiobuttonSuggestion.Active = s == Severity.Suggestion;
			buttonOk.Clicked += HandleClicked;
			buttonCancel.Clicked += (sender, e) => Destroy ();
			Response += (o, args) => {
				if (args.ResponseId == ResponseType.Close)
					Destroy ();
			};
		}
Example #5
0
        public CodeIssueOptionsDialog(BaseCodeIssueProvider inpector)
        {
            this.inpector = inpector;
            Build();
            HasSeparator = false;

            labelInspectionTitle.Text = inpector.Title;
            var s = inpector.GetSeverity();

            radiobuttonHide.Active       = s == Severity.None;
            radiobuttonError.Active      = s == Severity.Error;
            radiobuttonWarning.Active    = s == Severity.Warning;
            radiobuttonHint.Active       = s == Severity.Hint;
            radiobuttonSuggestion.Active = s == Severity.Suggestion;
            buttonOk.Clicked            += HandleClicked;
            buttonCancel.Clicked        += (sender, e) => Destroy();
            Response += (o, args) => {
                if (args.ResponseId == ResponseType.Close)
                {
                    Destroy();
                }
            };
        }
		public static string GetTitle (BaseCodeIssueProvider inspector)
		{
			if (inspector.Parent == null)
				return inspector.Title;
			return inspector.Parent.Title + " -> " + inspector.Title;
		}
		public InspectorResults (BaseCodeIssueProvider inspector, DomRegion region, string message, Severity level, IssueMarker mark, params GenericFix[] fixes)
			: base (region, message, level, mark, fixes)
		{
			this.Inspector = inspector;
		}
Example #8
0
 public void AddResult(ProjectFile file, BaseCodeIssueProvider provider, IEnumerable <CodeIssue> issues)
 {
     OnCodeIssueAdded(new CodeIssueEventArgs(file, provider, issues));
 }
Example #9
0
		public void AddResult (ProjectFile file, BaseCodeIssueProvider provider, IEnumerable<CodeIssue> issues)
		{
			OnCodeIssueAdded (new CodeIssueEventArgs(file, provider, issues));
		}
Example #10
0
		/// <summary>
		/// Initializes a new instance of the <see cref="CodeIssueEventArgs"/> class.
		/// </summary>
		/// <param name="codeIssues">The code issues.</param>
		public CodeIssueEventArgs (ProjectFile file, BaseCodeIssueProvider provider, IEnumerable<CodeIssue> codeIssues)
		{
			File = file;
			Provider = provider;
			CodeIssues = codeIssues as IList<CodeIssue> ?? codeIssues.ToList ();
		}
Example #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CodeIssueEventArgs"/> class.
 /// </summary>
 /// <param name="codeIssues">The code issues.</param>
 public CodeIssueEventArgs(ProjectFile file, BaseCodeIssueProvider provider, IEnumerable <CodeIssue> codeIssues)
 {
     File       = file;
     Provider   = provider;
     CodeIssues = codeIssues as IList <CodeIssue> ?? codeIssues.ToList();
 }
		public void AddError (ProjectFile file, BaseCodeIssueProvider provider)
		{
			Step ();
			wrappedJob.AddError (file, provider);
		}
		public void AddResult (ProjectFile file, BaseCodeIssueProvider provider, IEnumerable<CodeIssue> issues)
		{
			Step ();
			wrappedJob.AddResult (file, provider, issues);
		}
Example #14
0
		public void AddError (ProjectFile file, BaseCodeIssueProvider provider)
		{
		}
Example #15
0
 public void AddResult(ProjectFile file, BaseCodeIssueProvider provider, IEnumerable <CodeIssue> issues)
 {
     Step();
     wrappedJob.AddResult(file, provider, issues);
 }
Example #16
0
 public void AddError(ProjectFile file, BaseCodeIssueProvider provider)
 {
     Step();
     wrappedJob.AddError(file, provider);
 }
Example #17
0
 public void AddError(ProjectFile file, BaseCodeIssueProvider provider)
 {
 }