public void GetNameForExplicitImplementation() { var member = NormalizingMemberInfoFromExpressionUtility.GetMember((NestedType o) => o.Property); var result = MemberImplementationUtility.GetNameForExplicitImplementation(member); Assert.That( result, Is.EqualTo("Remotion.TypePipe.UnitTests.MutableReflection.Implementation.MemberImplementationUtilityTest.NestedType.Property")); }
private void ImplementReadOnlyProperty( Expression backingField, Expression initialization, PropertyInfo interfaceProperty, string debuggerDisplayNameString, string debuggerDisplayString) { var name = MemberImplementationUtility.GetNameForExplicitImplementation(interfaceProperty); var getMethod = _concreteTarget.AddExplicitOverride(interfaceProperty.GetGetMethod(), ctx => Expression.Block(initialization, backingField)); var property = _concreteTarget.AddProperty(name, PropertyAttributes.None, getMethod, setMethod: null); _attributeGenerator.AddDebuggerDisplayAttribute(property, debuggerDisplayString, debuggerDisplayNameString); }
private string GetIntroducedMemberName(MemberVisibility visibility, MemberInfo interfaceMember) { return(visibility == MemberVisibility.Public ? interfaceMember.Name : MemberImplementationUtility.GetNameForExplicitImplementation(interfaceMember)); }