Exemplo n.º 1
0
        public void AutoSaveEditResponse()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "EditMeetingResponseEventHandler.AutoSaveEditResponse");
            MeetingResponse meetingResponse = null;

            try
            {
                meetingResponse = base.GetRequestItem <MeetingResponse>(new PropertyDefinition[0]);
                base.UpdateMessageForAutoSave(meetingResponse, StoreObjectType.MeetingMessage);
                this.HandleSendOnBehalf(meetingResponse);
                Utilities.SaveItem(meetingResponse, true);
                base.WriteIdAndChangeKey(meetingResponse, true);
            }
            catch (Exception ex)
            {
                ExTraceGlobals.MailTracer.TraceError <string>((long)this.GetHashCode(), "EditMeetingResponseEventHandler.AutoSaveEditResponse - Exception {0} thrown during autosave", ex.Message);
                if (Utilities.ShouldSendChangeKeyForException(ex))
                {
                    ExTraceGlobals.MailDataTracer.TraceDebug <string>((long)this.GetHashCode(), "EditMessageEventHandler.TryProcessMessageRequestForAutoSave attempt to send change key on exception: {0}", ex.Message);
                    base.SaveIdAndChangeKeyInCustomErrorInfo(meetingResponse);
                }
                base.RenderErrorForAutoSave(ex);
            }
            finally
            {
                if (meetingResponse != null)
                {
                    meetingResponse.Dispose();
                    meetingResponse = null;
                }
            }
        }
Exemplo n.º 2
0
        public void Send()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "EditMeetingResponseEventHandler.SendEditResponse");
            MeetingResponse meetingResponse = base.GetRequestItem <MeetingResponse>(new PropertyDefinition[0]);

            try
            {
                if (base.UpdateMessage(meetingResponse, StoreObjectType.MeetingMessage))
                {
                    throw new OwaEventHandlerException("Unresolved recipients", LocalizedStrings.GetNonEncoded(2063734279));
                }
                if (meetingResponse.Recipients.Count == 0)
                {
                    throw new OwaEventHandlerException("No recipients", LocalizedStrings.GetNonEncoded(1878192149));
                }
                if (Utilities.RecipientsOnlyHaveEmptyPDL <Recipient>(base.UserContext, meetingResponse.Recipients))
                {
                    base.RenderPartialFailure(1389137820);
                }
                else
                {
                    this.HandleSendOnBehalf(meetingResponse);
                    base.SaveHideMailTipsByDefault();
                    ExTraceGlobals.CalendarTracer.TraceDebug((long)this.GetHashCode(), "Sending meeting response");
                    meetingResponse.Send();
                    OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("IdM");
                    if (owaStoreObjectId != null)
                    {
                        object parameter = base.GetParameter("PermanentDelete");
                        bool   flag      = parameter is bool && (bool)parameter;
                        if (flag)
                        {
                            Utilities.Delete(base.UserContext, DeleteItemFlags.SoftDelete, new OwaStoreObjectId[]
                            {
                                owaStoreObjectId
                            });
                        }
                        else
                        {
                            Utilities.Delete(base.UserContext, DeleteItemFlags.MoveToDeletedItems, new OwaStoreObjectId[]
                            {
                                owaStoreObjectId
                            });
                        }
                    }
                }
            }
            finally
            {
                if (meetingResponse != null)
                {
                    meetingResponse.Dispose();
                    meetingResponse = null;
                }
            }
        }
Exemplo n.º 3
0
        public void SaveEditResponse()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "EditMeetingResponseEventHandler.SaveEditResponse");
            MeetingResponse meetingResponse = base.GetRequestItem <MeetingResponse>(new PropertyDefinition[0]);

            try
            {
                base.UpdateMessage(meetingResponse, StoreObjectType.MeetingMessage);
                this.HandleSendOnBehalf(meetingResponse);
                base.SaveHideMailTipsByDefault();
                Utilities.SaveItem(meetingResponse);
                meetingResponse.Load();
                base.WriteChangeKey(meetingResponse);
            }
            finally
            {
                meetingResponse.Dispose();
                meetingResponse = null;
            }
        }
Exemplo n.º 4
0
        public virtual void RespondToEvent(StoreId id, RespondToEventParameters parameters, Event updateToEvent = null)
        {
            if (parameters == null)
            {
                throw new InvalidRequestException(CalendaringStrings.ErrorMissingRequiredRespondParameter);
            }
            MeetingResponse meetingResponse = null;

            try
            {
                try
                {
                    using (ICalendarItemBase calendarItemBase = this.Bind(id))
                    {
                        calendarItemBase.OpenAsReadWrite();
                        if (updateToEvent != null)
                        {
                            EventTranslator.Instance.SetPropertiesFromEntityOnStorageObject(updateToEvent, calendarItemBase);
                        }
                        meetingResponse = calendarItemBase.RespondToMeetingRequest(default(ResponseTypeConverter).Convert(parameters.Response), true, true, parameters.ProposedStartTime, parameters.ProposedEndTime);
                    }
                }
                catch (ObjectNotFoundException innerException)
                {
                    throw new AccessDeniedException(Strings.ErrorAccessDenied, innerException);
                }
                if (parameters.SendResponse)
                {
                    EventWorkflowParametersTranslator <RespondToEventParameters, RespondToEventParametersSchema> .Instance.SetPropertiesFromEntityOnStorageObject(parameters, meetingResponse);

                    MeetingMessage.SendLocalOrRemote(meetingResponse, true, true);
                }
            }
            finally
            {
                if (meetingResponse != null)
                {
                    meetingResponse.Dispose();
                }
            }
        }
        public void SaveMeetingResponse()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "EditMeetingInviteEventHandler.SaveMeetingResponse");
            MeetingResponse meetingResponse = null;

            try
            {
                meetingResponse = base.GetRequestItem <MeetingResponse>(new PropertyDefinition[0]);
                meetingResponse[ItemSchema.Subject] = (string)base.GetParameter("Subj");
                Utilities.SaveItem(meetingResponse);
                meetingResponse.Load();
                this.Writer.Write("<div id=ck>");
                this.Writer.Write(meetingResponse.Id.ChangeKeyAsBase64String());
                this.Writer.Write("</div>");
            }
            finally
            {
                if (meetingResponse != null)
                {
                    meetingResponse.Dispose();
                    meetingResponse = null;
                }
            }
        }