public void Apply(BaseTypeDeclarationTranslation typeDeclarationTranslation) { TypeDeclarationTranslation outerMemberDeclaration = (TypeDeclarationTranslation)typeDeclarationTranslation.TravelUpNotMe(f => f is TypeDeclarationTranslation); if (outerMemberDeclaration == null) { return; } SyntaxListBaseTranslation syntaxListBaseTranslation = (SyntaxListBaseTranslation)typeDeclarationTranslation.Parent; syntaxListBaseTranslation.Remove(typeDeclarationTranslation); SyntaxListBaseTranslation outerSyntaxListBaseTranslation = (SyntaxListBaseTranslation)outerMemberDeclaration.Parent; var newNamespace = CreateNewNamespace(outerMemberDeclaration.Syntax.Identifier.ToString(), typeDeclarationTranslation); outerSyntaxListBaseTranslation.Add(newNamespace); }
private ConstructorDeclarationTranslation FindConstructor(TypeDeclarationTranslation typeTranslation) { var constructor = typeTranslation.Members.GetEnumerable <ConstructorDeclarationTranslation>().FirstOrDefault(f => !f.IsDeclarationOverload); return(constructor); }