Ejemplo n.º 1
0
        private Inconsistency GetAttendeeMissingItemInconsistency(CalendarValidationContext context, string fullDescription, ClientIntentFlags?inconsistencyIntent, ClientIntentFlags declineIntent, ClientIntentFlags deleteIntent)
        {
            Inconsistency inconsistency = null;

            if (ClientIntentQuery.CheckDesiredClientIntent(inconsistencyIntent, new ClientIntentFlags[]
            {
                declineIntent
            }))
            {
                inconsistency        = ResponseInconsistency.CreateInstance(fullDescription, ResponseType.Decline, context.Attendee.ResponseType, ExDateTime.MinValue, context.Attendee.ReplyTime, context);
                inconsistency.Intent = inconsistencyIntent;
            }
            else if (ClientIntentQuery.CheckDesiredClientIntent(inconsistencyIntent, new ClientIntentFlags[]
            {
                deleteIntent
            }))
            {
                inconsistency = null;
            }
            else if (this.calendarIntent != null && this.calendarIntent.ItemVersion > 0)
            {
                inconsistency        = MissingItemInconsistency.CreateAttendeeMissingItemInstance(fullDescription, inconsistencyIntent, new int?(this.calendarIntent.ItemVersion), context);
                inconsistency.Intent = inconsistencyIntent;
            }
            return(inconsistency);
        }
Ejemplo n.º 2
0
        private Inconsistency GetAttendeeMissingItemInconsistency(CalendarValidationContext context, string fullDescription, ClientIntentQuery.QueryResult inconsistencyIntent, ClientIntentFlags declineIntent, ClientIntentFlags deleteIntent)
        {
            Inconsistency inconsistency = null;

            if (ClientIntentQuery.CheckDesiredClientIntent(inconsistencyIntent.Intent, new ClientIntentFlags[]
            {
                declineIntent
            }))
            {
                inconsistency        = ResponseInconsistency.CreateInstance(fullDescription, ResponseType.Decline, context.Attendee.ResponseType, ExDateTime.MinValue, context.Attendee.ReplyTime, context);
                inconsistency.Intent = inconsistencyIntent.Intent;
            }
            else if (ClientIntentQuery.CheckDesiredClientIntent(inconsistencyIntent.Intent, new ClientIntentFlags[]
            {
                deleteIntent
            }))
            {
                inconsistency = null;
            }
            else if (inconsistencyIntent.SourceVersionId != null)
            {
                int?deletedItemVersion = null;
                using (CalendarItemBase calendarItemBase = CalendarItemBase.Bind(this.session, inconsistencyIntent.SourceVersionId))
                {
                    deletedItemVersion = calendarItemBase.GetValueAsNullable <int>(CalendarItemBaseSchema.ItemVersion);
                }
                if (deletedItemVersion != null)
                {
                    inconsistency        = MissingItemInconsistency.CreateAttendeeMissingItemInstance(fullDescription, inconsistencyIntent.Intent, deletedItemVersion, context);
                    inconsistency.Intent = inconsistencyIntent.Intent;
                }
            }
            return(inconsistency);
        }
Ejemplo n.º 3
0
        protected override ConsistencyCheckResult DetectInconsistencies()
        {
            ConsistencyCheckResult consistencyCheckResult = ConsistencyCheckResult.CreateInstance(base.Type, base.Description);
            ResponseType           responseType           = base.Context.AttendeeItem.ResponseType;
            ResponseType           responseType2          = base.Context.Attendee.ResponseType;
            ExDateTime             replyTime            = base.Context.Attendee.ReplyTime;
            ExDateTime             appointmentReplyTime = base.Context.AttendeeItem.AppointmentReplyTime;

            if (!ExDateTime.MinValue.Equals(replyTime) && responseType != ResponseType.NotResponded && responseType2 != responseType)
            {
                consistencyCheckResult.Status = CheckStatusType.Failed;
                consistencyCheckResult.AddInconsistency(base.Context, ResponseInconsistency.CreateInstance(responseType, responseType2, appointmentReplyTime, replyTime, base.Context));
            }
            return(consistencyCheckResult);
        }
 internal static ResponseInconsistency CreateInstance(ResponseType attendeeResponse, ResponseType organizerResponse, ExDateTime attendeeReplyTime, ExDateTime organizerRecordedTime, CalendarValidationContext context)
 {
     return(ResponseInconsistency.CreateInstance(string.Empty, attendeeResponse, organizerResponse, attendeeReplyTime, organizerRecordedTime, context));
 }
Ejemplo n.º 5
0
 private void FailCheck(ConsistencyCheckResult result)
 {
     result.Status = CheckStatusType.Failed;
     result.AddInconsistency(base.Context, ResponseInconsistency.CreateInstance(base.Context.AttendeeItem.ResponseType, ResponseType.None, base.Context.AttendeeItem.AppointmentReplyTime, base.Context.Attendee.ReplyTime, base.Context));
 }