Beispiel #1
0
        private void SetOptionalAttendeeAvailability(AttendeeData attendee, IndividualAttendeeConflictData attendeeConflict)
        {
            BusyType busyType = attendeeConflict.BusyType;

            if (busyType == BusyType.NoData)
            {
                this.optionalAttendeeCount--;
                return;
            }
            if (busyType != BusyType.Free)
            {
                if (this.strongestOptConflict < busyType)
                {
                    this.strongestOptConflict = busyType;
                }
                this.optionalAttendeeConflictCount++;
                this.weightedOptConflicts += (double)busyType * 0.25 + 0.25;
                BusyType[] busyTypeRange = attendee.GetBusyTypeRange(this.meetingStartTime, this.meetingDuration);
                foreach (BusyType busyType2 in busyTypeRange)
                {
                    if (busyType2 != BusyType.Free)
                    {
                        this.optOverlap         += (double)this.options.FreeBusyInterval / (double)this.meetingDuration;
                        this.weightedOptOverlap += ((double)busyType * 0.25 + 0.25) * ((double)this.options.FreeBusyInterval / (double)this.meetingDuration);
                    }
                }
            }
        }
Beispiel #2
0
        private void SetRequiredAttendeeAvailability(AttendeeData attendee, IndividualAttendeeConflictData attendeeConflict)
        {
            BusyType busyType = attendeeConflict.BusyType;

            if (busyType == BusyType.NoData)
            {
                this.requiredAttendeeCount--;
                return;
            }
            if (this.strongestReqConflict < busyType)
            {
                this.strongestReqConflict = busyType;
            }
            if (busyType != BusyType.Free)
            {
                this.requiredAttendeeConflictCount++;
            }
            this.SetConvenience(attendee);
            int    num  = this.meetingDuration / this.options.FreeBusyInterval;
            int    num2 = 0;
            int    num3 = 0;
            double num4 = 0.0;

            if (num > 0)
            {
                BusyType[] busyTypeRange = attendee.GetBusyTypeRange(this.meetingStartTime, this.meetingDuration);
                ExDateTime startUtc      = this.meetingStartTime.ToUtc();
                foreach (BusyType busyType2 in busyTypeRange)
                {
                    ExDateTime exDateTime = startUtc.AddMinutes((double)this.options.FreeBusyInterval);
                    if (busyType2 != BusyType.Free)
                    {
                        num4 += this.GetConflictValue(busyType2);
                        num3++;
                    }
                    else if (!attendee.WorkingHours.IsWorkTime(startUtc, exDateTime))
                    {
                        num4 += 0.25;
                        num3++;
                    }
                    else if (num3 == 0)
                    {
                        num2++;
                    }
                    startUtc = exDateTime;
                }
                this.sumReqFrontTime += (double)num2 / (double)num;
                double num5 = (double)num2 / (double)num;
                if (num5 < this.minPctReqFrontTime)
                {
                    this.minPctReqFrontTime = num5;
                }
                this.weightedReqConflicts += num4 / (double)num;
            }
        }