22using Microsoft . CodeAnalysis . CSharp ;
33using Microsoft . CodeAnalysis . CSharp . Syntax ;
44using Microsoft . CodeAnalysis . Diagnostics ;
5+ using System ;
56using System . Collections . Generic ;
67using System . Linq ;
78
@@ -207,7 +208,7 @@ private IEnumerable<AttributeData> GetInterfaceDiagnosticAttributes(ITypeSymbol
207208 {
208209 foreach ( var attribuete in interfaceSymbol . GetAttributes ( ) )
209210 {
210- if ( this . CtorAttribueIsDefind ( attribuete , AttributeCtorTargets . Interface ) == false )
211+ if ( this . CtorAttribueIsDefind ( attribuete , AttributeTargets . Interface ) == false )
211212 {
212213 yield return attribuete ;
213214 }
@@ -223,7 +224,7 @@ private IEnumerable<AttributeData> GetMethodDiagnosticAttributes(IMethodSymbol m
223224 {
224225 foreach ( var methodAttribuete in methodSymbol . GetAttributes ( ) )
225226 {
226- if ( this . CtorAttribueIsDefind ( methodAttribuete , AttributeCtorTargets . Method ) == false )
227+ if ( this . CtorAttribueIsDefind ( methodAttribuete , AttributeTargets . Method ) == false )
227228 {
228229 yield return methodAttribuete ;
229230 }
@@ -233,7 +234,7 @@ private IEnumerable<AttributeData> GetMethodDiagnosticAttributes(IMethodSymbol m
233234 {
234235 foreach ( var parameterAttribute in parameter . GetAttributes ( ) )
235236 {
236- if ( this . CtorAttribueIsDefind ( parameterAttribute , AttributeCtorTargets . Parameter ) == false )
237+ if ( this . CtorAttribueIsDefind ( parameterAttribute , AttributeTargets . Parameter ) == false )
237238 {
238239 yield return parameterAttribute ;
239240 }
@@ -248,7 +249,7 @@ private IEnumerable<AttributeData> GetMethodDiagnosticAttributes(IMethodSymbol m
248249 /// <param name="attributeData"></param>
249250 /// <param name="targets">指定目标</param>
250251 /// <returns></returns>
251- private bool CtorAttribueIsDefind ( AttributeData attributeData , AttributeCtorTargets targets )
252+ private bool CtorAttribueIsDefind ( AttributeData attributeData , AttributeTargets targets )
252253 {
253254 var ctorAttributes = attributeData . AttributeConstructor ? . GetAttributes ( ) ;
254255 if ( ctorAttributes . HasValue == false )
@@ -270,7 +271,7 @@ private bool CtorAttribueIsDefind(AttributeData attributeData, AttributeCtorTarg
270271 return true ;
271272 }
272273
273- var ctorTargets = ( AttributeCtorTargets ) arg . Value ;
274+ var ctorTargets = ( AttributeTargets ) arg . Value ;
274275 return ctorTargets . HasFlag ( targets ) ;
275276 }
276277 }
0 commit comments