Exemplo n.º 1
0
        public override void TraverseChildren(IBoundExpression boundExpression)
        {
            var tm = boundExpression.Definition as ITypeMemberReference;

            if (tm != null)
            {
                var    resolvedMember = tm.ResolvedTypeDefinitionMember;
                string propertyName   = ContractHelper.GetStringArgumentFromAttribute(resolvedMember.Attributes, "System.Diagnostics.Contracts.ContractPublicPropertyNameAttribute");
                // we don't care what it is, it just means it has a public property that represents it
                // so if it is null, then it is *not* a field that has a [ContractPublicPropertyName] marking
                // and so its visibility counts. If it *is* such a field, then it is considered to be public.
                // (TODO: checker should make sure that the property it names is public.)
                if (propertyName == null)
                {
                    this.currentVisibility = TypeHelper.VisibilityIntersection(this.currentVisibility, resolvedMember.Visibility);
                }
            }
            base.TraverseChildren(boundExpression);
        }