예제 #1
0
        internal ADRawEntry GetCachedRecipient(Participant participant)
        {
            if (this.outboundOptions == null || this.outboundOptions.RecipientCache == null)
            {
                return(null);
            }
            if (participant == null)
            {
                return(null);
            }
            ProxyAddress proxyAddressForParticipant = OutboundAddressCache.GetProxyAddressForParticipant(participant);

            if (proxyAddressForParticipant == null)
            {
                return(null);
            }
            Result <ADRawEntry> result;

            if (this.outboundOptions.RecipientCache.TryGetValue(proxyAddressForParticipant, out result) && result.Error == null)
            {
                return(result.Data);
            }
            return(null);
        }
예제 #2
0
        internal bool?IsDelegateOfPrincipal(Participant principal, Participant delegateParticipant)
        {
            if (this.outboundOptions == null || this.outboundOptions.RecipientCache == null)
            {
                return(null);
            }
            ProxyAddress proxyAddressForParticipant = OutboundAddressCache.GetProxyAddressForParticipant(principal);

            if (proxyAddressForParticipant == null)
            {
                return(null);
            }
            Result <ADRawEntry> result;

            if (this.outboundOptions.RecipientCache.TryGetValue(proxyAddressForParticipant, out result))
            {
                ADRawEntry data = result.Data;
                if (data == null)
                {
                    return(null);
                }
                MultiValuedProperty <ADObjectId> multiValuedProperty = data[ADRecipientSchema.GrantSendOnBehalfTo] as MultiValuedProperty <ADObjectId>;
                if (multiValuedProperty == null || multiValuedProperty.Count == 0)
                {
                    return(new bool?(false));
                }
                ProxyAddress proxyAddressForParticipant2 = OutboundAddressCache.GetProxyAddressForParticipant(delegateParticipant);
                if (proxyAddressForParticipant2 == null)
                {
                    return(null);
                }
                Result <ADRawEntry> result2;
                if (this.outboundOptions.RecipientCache.TryGetValue(proxyAddressForParticipant2, out result2))
                {
                    ADRawEntry data2 = result2.Data;
                    if (data2 == null)
                    {
                        return(null);
                    }
                    ADObjectId adobjectId = data2[ADObjectSchema.Id] as ADObjectId;
                    if (adobjectId == null)
                    {
                        goto IL_13A;
                    }
                    using (MultiValuedProperty <ADObjectId> .Enumerator enumerator = multiValuedProperty.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            ADObjectId x = enumerator.Current;
                            if (ADObjectId.Equals(x, adobjectId))
                            {
                                return(new bool?(true));
                            }
                        }
                        goto IL_13A;
                    }
                }
                return(null);
            }
IL_13A:
            return(new bool?(false));
        }