Esempio n. 1
0
        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"));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 private string GetIntroducedMemberName(MemberVisibility visibility, MemberInfo interfaceMember)
 {
     return(visibility == MemberVisibility.Public
          ? interfaceMember.Name
          : MemberImplementationUtility.GetNameForExplicitImplementation(interfaceMember));
 }