Пример #1
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);
            }
 internal IssueTreeNode(IssueManager.IssueProvider provider, Action checkedChanged)
 {
     this.Provider         = provider;
     this.attribute        = provider.Attribute;
     this.checkedChanged   = checkedChanged;
     this.PropertyChanged += OnPropertyChanged;
 }
        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");
        }
Пример #4
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");
 }
Пример #5
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");
 }
Пример #6
0
 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;
 }
 internal IssueTreeNode(IssueManager.IssueProvider provider)
 {
     this.Provider  = provider;
     this.attribute = provider.Attribute;
 }
Пример #8
0
 public NRefactoryIssueProvider(ICSharpCode.NRefactory.PlayScript.Refactoring.ICodeIssueProvider issue, IssueDescriptionAttribute attr)
 {
     issueProvider    = issue;
     providerIdString = issueProvider.GetType().FullName;
     Category         = GettextCatalog.GetString(attr.Category ?? "");
     Title            = GettextCatalog.GetString(attr.Title ?? "");
     Description      = GettextCatalog.GetString(attr.Description ?? "");
     DefaultSeverity  = (ICSharpCode.NRefactory.CSharp.Severity)attr.Severity;
     IssueMarker      = (ICSharpCode.NRefactory.CSharp.IssueMarker)attr.IssueMarker;
     MimeType         = "text/x-playscript";
 }
 internal IssueOptionsViewModel(IssueManager.IssueProvider provider)
 {
     this.Provider  = provider;
     this.attribute = provider.Attribute;
     this.Severity  = attribute.Severity;
 }