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();

            // 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");
        }
Пример #2
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");
 }
Пример #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");
 }
		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 ();

			counter = InstrumentationService.CreateTimerCounter (IdString, "CodeIssueProvider run times");
		}
		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");
		}
		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");
		}