/// <summary> /// Copy initializes a new instance of the <see cref="FieldDefinitionTranslationUnitFactory"/> class. /// </summary> /// <param name="other"></param> /// <remarks> /// For testability. /// </remarks> public FieldDefinitionTranslationUnitFactory(FieldDefinitionTranslationUnitFactory other) : base(other) { this.createWhenProtected = other.createWhenProtected; }
/// <summary> /// /// </summary> /// <param name="node"></param> public override void VisitFieldDeclaration(FieldDeclarationSyntax node) { var fieldDefinitionTranslationUnit = new FieldDefinitionTranslationUnitFactory(node, this.semanticModel, this.generateTranslationUniOnProtectedMembers).Create(); if (fieldDefinitionTranslationUnit == 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.AddMemberDeclaration(fieldDefinitionTranslationUnit); this.InvokeFieldDeclarationVisited(this, new WalkerEventArgs()); }