Esempio n. 1
0
        public static bool MatchConnectionState(ADSessionInfo info1, ADSessionInfo info2, bool ignoreLocatorFlags)
        {
            bool     valueOrDefault;
            TimeSpan?timeout  = info1.Timeout;
            TimeSpan?nullable = info2.Timeout;

            if (timeout.HasValue != nullable.HasValue)
            {
                valueOrDefault = false;
            }
            else
            {
                if (!timeout.HasValue)
                {
                    valueOrDefault = true;
                }
                else
                {
                    valueOrDefault = timeout.GetValueOrDefault() == nullable.GetValueOrDefault();
                }
            }
            if (!valueOrDefault || info1.AuthType != info2.AuthType)
            {
                return(false);
            }
            else
            {
                return(ADSessionOptions.MatchConnectionState(info1.Options, info2.Options, ignoreLocatorFlags));
            }
        }