Browse Source

Move ExportAnalyzerAttribute to separate file.

pull/2639/head
Siegfried Pammer 3 years ago
parent
commit
e410df58b8
  1. 35
      ILSpy/Analyzers/ExportAnalyzerAttribute.cs
  2. 14
      ILSpy/Analyzers/IAnalyzer.cs

35
ILSpy/Analyzers/ExportAnalyzerAttribute.cs

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
// Copyright (c) 2018 Siegfried Pammer
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel.Composition;
namespace ICSharpCode.ILSpy.Analyzers
{
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class ExportAnalyzerAttribute : ExportAttribute, IAnalyzerMetadata
{
public ExportAnalyzerAttribute() : base("Analyzer", typeof(IAnalyzer))
{ }
public string Header { get; set; }
public int Order { get; set; }
}
}

14
ILSpy/Analyzers/IAnalyzer.cs

@ -16,9 +16,7 @@ @@ -16,9 +16,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using ICSharpCode.Decompiler.TypeSystem;
@ -41,18 +39,6 @@ namespace ICSharpCode.ILSpy.Analyzers @@ -41,18 +39,6 @@ namespace ICSharpCode.ILSpy.Analyzers
IEnumerable<ISymbol> Analyze(ISymbol analyzedSymbol, AnalyzerContext context);
}
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class ExportAnalyzerAttribute : ExportAttribute, IAnalyzerMetadata
{
public ExportAnalyzerAttribute() : base("Analyzer", typeof(IAnalyzer))
{ }
public string Header { get; set; }
public int Order { get; set; }
}
public interface IAnalyzerMetadata
{
string Header { get; }

Loading…
Cancel
Save