public override void Translate(MemberAccessExpression model, TranslationContext context) { if (HandleEnumMember(model, context) || HandleExtensionMethod(model, context)) { return; } var hasExpression = false; var hasMember = false; var length = context.Length; // write the member access expression context.WriteModel(model.Expression); if (context.Length > length) { // check if any text was actually written. hasExpression = true; length = context.Length; } // get a placeholder to the dot position var dotWriter = context.CreatePositionalWriter(); // account for making explicit base calls. if (model.Expression as BaseExpression != null) { context.UsingExplicitCall = true; } // write the member name context.WriteModel(model.Member); // check again if any text was written. if (context.Length > length) { hasMember = true; } // if the member access wrote text for both the // expression and member, add a dot between them if (hasExpression && hasMember) { dotWriter.Write("."); } }