private ClientIntentQuery.QueryResult GetMissingItemIntent(CalendarValidationContext context, bool isNotOccurrence)
        {
            ClientIntentQuery clientIntentQuery;

            if (isNotOccurrence)
            {
                ICalendarItemStateDefinition deletedFromFolderStateDefinition = CompositeCalendarItemStateDefinition.GetDeletedFromFolderStateDefinition(this.CalendarFolderId);
                clientIntentQuery = new ItemDeletionClientIntentQuery(context.BaseItem.GlobalObjectId, deletedFromFolderStateDefinition);
            }
            else
            {
                ICalendarItemStateDefinition targetState = new DeletedOccurrenceCalendarItemStateDefinition(context.BaseItem.GlobalObjectId.Date, false);
                clientIntentQuery = new NonTransitionalClientIntentQuery(context.BaseItem.GlobalObjectId, targetState);
            }
            return(clientIntentQuery.Execute(this.session, context.CvsGateway));
        }
Example #2
0
        private static bool TryGetCancelledVersionIdFromCvs(CalendarVersionStoreGateway cvsGateway, GlobalObjectId globalObjectId, MailboxSession session, byte[] calendarFolderId, out VersionedId deletedVersionId)
        {
            ClientIntentFlags clientIntentFlags;
            ClientIntentQuery clientIntentQuery;

            if (globalObjectId.IsCleanGlobalObjectId)
            {
                clientIntentFlags = ClientIntentFlags.MeetingCanceled;
                ICalendarItemStateDefinition deletedFromFolderStateDefinition = CompositeCalendarItemStateDefinition.GetDeletedFromFolderStateDefinition(calendarFolderId);
                clientIntentQuery = new ItemDeletionClientIntentQuery(globalObjectId, deletedFromFolderStateDefinition);
            }
            else
            {
                clientIntentFlags = ClientIntentFlags.MeetingExceptionCanceled;
                ICalendarItemStateDefinition targetState = new DeletedOccurrenceCalendarItemStateDefinition(globalObjectId.Date, false);
                clientIntentQuery = new NonTransitionalClientIntentQuery(globalObjectId, targetState);
            }
            ClientIntentQuery.QueryResult queryResult = clientIntentQuery.Execute(session, cvsGateway);
            deletedVersionId = queryResult.SourceVersionId;
            return(ClientIntentQuery.CheckDesiredClientIntent(queryResult.Intent, new ClientIntentFlags[]
            {
                clientIntentFlags
            }));
        }