Permalink
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (21 sloc) 1.19 KB
// Copyright (c) Josef Pihrt. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Roslynator.CSharp.Refactorings.SortMemberDeclarations;
namespace Roslynator.CSharp.Refactorings
{
internal static class InterfaceDeclarationRefactoring
{
public static void ComputeRefactorings(RefactoringContext context, InterfaceDeclarationSyntax interfaceDeclaration)
{
if (context.IsRefactoringEnabled(RefactoringIdentifiers.AddTypeParameter))
AddTypeParameterRefactoring.ComputeRefactoring(context, interfaceDeclaration);
if (context.IsRefactoringEnabled(RefactoringIdentifiers.ExtractTypeDeclarationToNewFile))
ExtractTypeDeclarationToNewFileRefactoring.ComputeRefactorings(context, interfaceDeclaration);
if (context.IsRefactoringEnabled(RefactoringIdentifiers.SortMemberDeclarations)
&& interfaceDeclaration.BracesSpan().Contains(context.Span))
{
SortMemberDeclarationsRefactoring.ComputeRefactoring(context, interfaceDeclaration);
}
}
}
}