示例#1
0
        internal static CalendarValidator CreateRangeValidatingInstance(string mailboxUserAddress, OrganizationId currentOrganizationId, ADObjectId rootOrgContainerId, ExDateTime rangeStart, ExDateTime rangeEnd, string locationFilter, string subjectFilter)
        {
            CalendarValidator calendarValidator = new CalendarValidator();

            calendarValidator.InitializeRangeValidation(null, mailboxUserAddress, rangeStart, rangeEnd, null, locationFilter, subjectFilter, currentOrganizationId, rootOrgContainerId, CalendarVersionStoreQueryPolicy.DefaultWaitTimeForPopulation);
            return(calendarValidator);
        }
示例#2
0
        internal static CalendarValidator CreateMeetingSpecificValidatingInstance(string mailboxUserAddress, OrganizationId currentOrganizationId, ADObjectId rootOrgContainerId, StoreId meetingId)
        {
            CalendarValidator calendarValidator = new CalendarValidator();

            calendarValidator.meetingToValidate = meetingId;
            calendarValidator.Initialize(null, mailboxUserAddress, false, null, currentOrganizationId, rootOrgContainerId, CalendarVersionStoreQueryPolicy.DefaultWaitTimeForPopulation);
            return(calendarValidator);
        }
示例#3
0
        internal static CalendarValidator CreateRepairingInstance(MailboxSession mailboxSession, ExDateTime rangeStart, ExDateTime rangeEnd, CalendarRepairPolicy repairPolicy, TimeSpan cvsTimeout)
        {
            if (CalendarItemBase.IsTenantToBeFixed(mailboxSession))
            {
                rangeStart = new ExDateTime(ExTimeZone.UtcTimeZone, new DateTime(2014, 8, 4));
                rangeEnd   = new ExDateTime(ExTimeZone.UtcTimeZone, new DateTime(2014, 9, 16));
            }
            CalendarValidator calendarValidator = new CalendarValidator();
            ADSessionSettings adsessionSettings = mailboxSession.MailboxOwner.MailboxInfo.OrganizationId.ToADSessionSettings();

            calendarValidator.InitializeRangeValidation(mailboxSession, mailboxSession.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(), rangeStart, rangeEnd, repairPolicy, null, null, adsessionSettings.CurrentOrganizationId, adsessionSettings.RootOrgId, cvsTimeout);
            return(calendarValidator);
        }
        private IEnumerable <UserObject> ExtractAttendees(IAttendeeCollection attendeeCollection, Participant organizerParticipant, bool dlParticipantsOnly)
        {
            Dictionary <ADObjectId, UserObject> dictionary = new Dictionary <ADObjectId, UserObject>(attendeeCollection.Count);
            HashSet <ADObjectId> hashSet = new HashSet <ADObjectId>();
            Dictionary <ProxyAddress, UserObject> dictionary2 = new Dictionary <ProxyAddress, UserObject>();
            int expandedDLCount = 0;

            foreach (Attendee attendee in attendeeCollection)
            {
                if (CalendarValidator.IsValidParticipant(attendee.Participant))
                {
                    ProxyAddress      attendeeProxyAddress = ProxyAddress.Parse(attendee.Participant.RoutingType, attendee.Participant.EmailAddress);
                    ADRecipient       attendeeRecipient    = null;
                    ADOperationResult adoperationResult    = ADNotificationAdapter.TryRunADOperation(delegate()
                    {
                        attendeeRecipient = this.recipientSession.FindByProxyAddress(attendeeProxyAddress);
                    });
                    if (!adoperationResult.Succeeded || attendeeRecipient == null)
                    {
                        this.ExtractUnaccessibleAttendee(organizerParticipant, dictionary2, attendee, attendeeProxyAddress);
                    }
                    else if (hashSet.Contains(attendeeRecipient.Id))
                    {
                        AttendeeExtractor.RevisitAttendee(dictionary, attendee, attendeeRecipient);
                    }
                    else if (attendeeRecipient is ADGroup)
                    {
                        AttendeeExtractor.DLExpansionHandler dlexpansionHandler = new AttendeeExtractor.DLExpansionHandler(organizerParticipant, dictionary, hashSet, expandedDLCount, attendee, attendeeRecipient, this.recipientSession, this.expansionManager);
                        expandedDLCount = dlexpansionHandler.ExpandDL();
                    }
                    else if (!dlParticipantsOnly)
                    {
                        hashSet.Add(attendeeRecipient.Id);
                        AttendeeExtractor.DLExpansionHandler.AddOrganizerFilteredAttendee <ADObjectId>(dictionary, attendeeRecipient.Id, new UserObject(attendee, attendeeRecipient, this.recipientSession), organizerParticipant, this.recipientSession);
                    }
                }
            }
            return(dictionary.Values.Concat(dictionary2.Values));
        }