本文整理汇总了C#中ICSharpCode.NRefactory.CSharp.Refactoring.BaseRefactoringContext.Supports方法的典型用法代码示例。如果您正苦于以下问题:C# BaseRefactoringContext.Supports方法的具体用法?C# BaseRefactoringContext.Supports怎么用?C# BaseRefactoringContext.Supports使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.NRefactory.CSharp.Refactoring.BaseRefactoringContext
的用法示例。
在下文中一共展示了BaseRefactoringContext.Supports方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBackingField
internal static IField GetBackingField (BaseRefactoringContext context, PropertyDeclaration propertyDeclaration)
{
// automatic properties always need getter & setter
if (propertyDeclaration == null || propertyDeclaration.Getter.IsNull || propertyDeclaration.Setter.IsNull || propertyDeclaration.Getter.Body.IsNull || propertyDeclaration.Setter.Body.IsNull)
return null;
if (!context.Supports(csharp3) || propertyDeclaration.HasModifier (ICSharpCode.NRefactory.CSharp.Modifiers.Abstract) || ((TypeDeclaration)propertyDeclaration.Parent).ClassType == ClassType.Interface)
return null;
var getterField = ScanGetter (context, propertyDeclaration);
if (getterField == null)
return null;
var setterField = ScanSetter (context, propertyDeclaration);
if (setterField == null)
return null;
if (!getterField.Equals(setterField))
return null;
return getterField;
}