public NRefactoryIssueProvider (ICSharpCode.NRefactory.CSharp.Refactoring.ICodeIssueProvider issue, IssueDescriptionAttribute attr)
		{
			issueProvider = issue;
			MimeType = "text/x-csharp";
			Category = GettextCatalog.GetString (attr.Category ?? "");
			Title = GettextCatalog.GetString (attr.Title ?? "");
			Description = GettextCatalog.GetString (attr.Description ?? "");
			DefaultSeverity = attr.Severity;
			IssueMarker = attr.IssueMarker;
		}
		public NRefactoryIssueProvider (ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssueProvider issue, IssueDescriptionAttribute attr)
		{
			issueProvider = issue;
			this.attr = attr;
			providerIdString = issueProvider.GetType ().FullName;
			Category = GettextCatalog.GetString (attr.Category ?? "");
			Title = GettextCatalog.GetString (attr.Title ?? "");
			Description = GettextCatalog.GetString (attr.Description ?? "");
			DefaultSeverity = attr.Severity;
			SetMimeType ("text/x-csharp");
		}
Ejemplo n.º 3
0
		public NRefactoryIssueProvider (ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssueProvider issue, IssueDescriptionAttribute attr)
		{
			issueProvider = issue;
			this.attr = attr;
			providerIdString = issueProvider.GetType ().FullName;
			Category = GettextCatalog.GetString (attr.Category ?? "");
			Title = GettextCatalog.GetString (attr.Title ?? "");
			Description = GettextCatalog.GetString (attr.Description ?? "");
			DefaultSeverity = attr.Severity;
			SetMimeType ("text/x-csharp");
			subIssues = issueProvider.SubIssues.Select (subIssue => (BaseCodeIssueProvider)new BaseNRefactoryIssueProvider (this, subIssue)).ToList ();
			counter = InstrumentationService.CreateTimerCounter (IdString, "CodeIssueProvider run times");
		}
Ejemplo n.º 4
0
			public IssueProvider(CodeIssueProvider provider)
			{
				if (provider == null)
					throw new ArgumentNullException("provider");
				this.ProviderType = provider.GetType();
				var attributes = ProviderType.GetCustomAttributes(typeof(IssueDescriptionAttribute), true);
				
				Severity defaultSeverity = Severity.Hint;
				if (attributes.Length == 1) {
					this.Attribute = (IssueDescriptionAttribute)attributes[0];
					defaultSeverity = this.Attribute.Severity;
					IsRedundancy = this.Attribute.Category == IssueCategories.RedundanciesInCode || this.Attribute.Category == IssueCategories.RedundanciesInDeclarations;
				} else {
					SD.Log.Warn("Issue provider without attribute: " + ProviderType);
				}
				var properties = PropertyService.NestedProperties("CSharpIssueSeveritySettings");
				this.CurrentSeverity = properties.Get(ProviderType.FullName, defaultSeverity);
			}
		public NRefactoryIssueProvider (ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssueProvider issue, IssueDescriptionAttribute attr)
		{
			issueProvider = issue;
			this.attr = attr;
			providerIdString = issueProvider.GetType ().FullName;
			Category = GettextCatalog.GetString (attr.Category ?? "");
			Title = GettextCatalog.GetString (attr.Title ?? "");
			Description = GettextCatalog.GetString (attr.Description ?? "");
			DefaultSeverity = attr.Severity;
			IsEnabledByDefault = attr.IsEnabledByDefault;
			SetMimeType ("text/x-csharp");
			subIssues = issueProvider.SubIssues.Select (subIssue => (BaseCodeIssueProvider)new BaseNRefactoryIssueProvider (this, subIssue)).ToList ();

			// Additional source of actions
			var actionProvider = attr.ActionProvider;
			if (actionProvider != null) {
				var actionAttr = actionProvider.GetCustomAttributes (typeof(ContextActionAttribute), false);
				if (actionAttr != null && actionAttr.Length == 1)
					boundActionProvider = (ICSharpCode.NRefactory.CSharp.Refactoring.CodeActionProvider)Activator.CreateInstance (actionProvider);
			}

			counter = InstrumentationService.CreateTimerCounter (IdString, "CodeIssueProvider run times");
		}
			internal IssueTreeNode(IssueManager.IssueProvider provider)
			{
				this.Provider = provider;
				this.attribute = provider.Attribute;
			}
		internal IssueOptionsViewModel(IssueManager.IssueProvider provider)
		{
			this.Provider = provider;
			this.attribute = provider.Attribute;
			this.Severity = attribute.Severity;
		}
			internal IssueTreeNode(IssueManager.IssueProvider provider, Action checkedChanged)
			{
				this.Provider = provider;
				this.attribute = provider.Attribute;
				this.checkedChanged = checkedChanged;
				this.PropertyChanged += OnPropertyChanged;
			}