/// <summary> /// /// </summary> /// <param name="node"></param> /// <remarks> /// This will cause an AST walker to be created, thus we don't need to go further deeper in the /// tree by visiting the node. /// </remarks> public override void VisitMethodDeclaration(MethodDeclarationSyntax node) { var methodDefinitionTranslationUnit = new MethodDefinitionTranslationUnitFactory(node, this.semanticModel, this.generateTranslationUniOnProtectedMembers).Create(); if (methodDefinitionTranslationUnit == null) { // When the factory returns null, then the member is not exposed, thus we do not generate it in the translation tree return; } this.classDeclaration.AddMethodDeclaration(methodDefinitionTranslationUnit); this.InvokeMethodDeclarationVisited(this, new WalkerEventArgs()); }
/// <summary> /// Copy initializes a new instance of the <see cref="MethodDefinitionTranslationUnitFactory"/> class. /// </summary> /// <param name="other"></param> /// <remarks> /// For testability. /// </remarks> public MethodDefinitionTranslationUnitFactory(MethodDefinitionTranslationUnitFactory other) : base(other) { this.createWhenProtected = other.createWhenProtected; }
/// <summary> /// Copy initializes a new instance of the <see cref="MethodDefinitionTranslationUnitFactory"/> class. /// </summary> /// <param name="other"></param> /// <remarks> /// For testability. /// </remarks> public MethodDefinitionTranslationUnitFactory(MethodDefinitionTranslationUnitFactory other) : base(other) { this.createWhenProtected = other.createWhenProtected; }