IEnumerable <IMethodReference> IPropertyDefinition.GetAccessors(EmitContext context)
        {
            CheckDefinitionInvariant();

            MethodSymbol getMethod = this.GetMethod;

            if (getMethod != null && getMethod.ShouldInclude(context))
            {
                yield return(getMethod);
            }

            MethodSymbol setMethod = this.SetMethod;

            if (setMethod != null && setMethod.ShouldInclude(context))
            {
                yield return(setMethod);
            }

            var sourceProperty = this as SourcePropertySymbolBase;

            if ((object)sourceProperty != null && sourceProperty.ShouldInclude(context))
            {
                SynthesizedSealedPropertyAccessor synthesizedAccessor = sourceProperty.SynthesizedSealedAccessorOpt;
                if ((object)synthesizedAccessor != null)
                {
                    yield return(synthesizedAccessor);
                }
            }
        }
Example #2
0
        private Cci.IMethodReference GetSynthesizedSealedAccessor(MethodKind targetMethodKind)
        {
            SourcePropertySymbol sourceProperty = this as SourcePropertySymbol;

            if ((object)sourceProperty != null)
            {
                SynthesizedSealedPropertyAccessor synthesized = sourceProperty.SynthesizedSealedAccessorOpt;
                return((object)synthesized != null && synthesized.MethodKind == targetMethodKind ? synthesized : null);
            }

            return(null);
        }