public TransitionalClientIntentQuery(GlobalObjectId globalObjectId, ICalendarItemStateDefinition initialState, ICalendarItemStateDefinition targetState) : base(globalObjectId, targetState)
 {
     Util.ThrowOnNullArgument(initialState, "initialState");
     if (!initialState.SchemaKey.Equals(targetState.SchemaKey))
     {
         throw new ArgumentException(string.Format("Cannot query client intent for a transition between heterogeneous states (Initial: {0}; Target: {1}).", initialState.SchemaKey, targetState.SchemaKey));
     }
     this.InitialState = initialState;
 }
        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 #3
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
            }));
        }
 public override bool Equals(ICalendarItemStateDefinition other)
 {
     return(other is SinglePropertyValueBasedCalendarItemStateDefinition <TValue> && this.Equals((SinglePropertyValueBasedCalendarItemStateDefinition <TValue>)other));
 }
Example #5
0
 public NonTransitionalClientIntentQuery(GlobalObjectId globalObjectId, ICalendarItemStateDefinition targetState) : base(globalObjectId, targetState)
 {
 }
Example #6
0
 public abstract bool Equals(ICalendarItemStateDefinition other);
Example #7
0
 protected ClientIntentQuery(GlobalObjectId globalObjectId, ICalendarItemStateDefinition targetState)
 {
     Util.ThrowOnNullArgument(targetState, "targetState");
     this.GlobalObjectId = globalObjectId;
     this.TargetState    = targetState;
 }
Example #8
0
 public ItemDeletionClientIntentQuery(GlobalObjectId globalObjectId, ICalendarItemStateDefinition targetState) : base(globalObjectId, targetState)
 {
 }
 public override bool Equals(ICalendarItemStateDefinition other)
 {
     return(other is DeletedOccurrenceCalendarItemStateDefinition && this.Equals((DeletedOccurrenceCalendarItemStateDefinition)other));
 }