public LogIntroducerContextAction(ICSharpContextActionDataProvider provider) { factory = provider.ElementFactory; classDeclaration = provider.GetSelectedElement <IClassDeclaration>(); literalExpression = provider.GetSelectedElement <ICSharpLiteralExpression>(); file = classDeclaration?.GetContainingFile() as ICSharpFile; }
private UnitTestElementLocation GetUnitTestElementLocation(IClassDeclaration declaration) { var navigationRange = declaration.GetNameDocumentRange().TextRange; var containingRange = declaration.GetDocumentRange().TextRange; var projectFile = declaration.GetContainingFile().AssertNotNull().GetSourceFile().ToProjectFile(); return new UnitTestElementLocation(projectFile, navigationRange, containingRange); }
private UnitTestElementLocation GetUnitTestElementLocation(IClassDeclaration declaration) { var navigationRange = declaration.GetNameDocumentRange().TextRange; var containingRange = declaration.GetDocumentRange().TextRange; var projectFile = declaration.GetContainingFile().AssertNotNull().GetSourceFile().ToProjectFile(); return(new UnitTestElementLocation(projectFile, navigationRange, containingRange)); }