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)); }
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)); }
public NonTransitionalClientIntentQuery(GlobalObjectId globalObjectId, ICalendarItemStateDefinition targetState) : base(globalObjectId, targetState) { }
public abstract bool Equals(ICalendarItemStateDefinition other);
protected ClientIntentQuery(GlobalObjectId globalObjectId, ICalendarItemStateDefinition targetState) { Util.ThrowOnNullArgument(targetState, "targetState"); this.GlobalObjectId = globalObjectId; this.TargetState = targetState; }
public ItemDeletionClientIntentQuery(GlobalObjectId globalObjectId, ICalendarItemStateDefinition targetState) : base(globalObjectId, targetState) { }
public override bool Equals(ICalendarItemStateDefinition other) { return(other is DeletedOccurrenceCalendarItemStateDefinition && this.Equals((DeletedOccurrenceCalendarItemStateDefinition)other)); }