Exemplo n.º 1
0
        /// <summary>
        /// Translates a <see cref="OlResponseStatus"/> into a <see cref="ResponseStatus"/>.
        /// </summary>
        /// <param name="status">
        /// The <see cref="OlResponseStatus"/> to translate into a <see cref="ResponseStatus"/>.
        /// </param>
        /// <returns>
        /// The corresponding <see cref="ResponseStatus"/>.
        /// </returns>
        /// <exception cref="ArgumentOutOfRangeException">
        /// In case of an unknown <see cref="OlResponseStatus"/>.
        /// </exception>
        public static ResponseStatus ToResponseStatus(this OlResponseStatus status)
        {
            switch (status)
            {
            case OlResponseStatus.olResponseNone:
                return(ResponseStatus.Undefined);

            case OlResponseStatus.olResponseOrganized:
                return(ResponseStatus.Organized);

            case OlResponseStatus.olResponseTentative:
                return(ResponseStatus.Tentative);

            case OlResponseStatus.olResponseAccepted:
                return(ResponseStatus.Accepted);

            case OlResponseStatus.olResponseDeclined:
                return(ResponseStatus.Declined);

            case OlResponseStatus.olResponseNotResponded:
                return(ResponseStatus.NotResponded);

            default:
                throw new ArgumentOutOfRangeException("status");
            }
        }
Exemplo n.º 2
0
        private string MeetingResponseToStr(OlResponseStatus response)
        {
            // https://docs.microsoft.com/de-de/office/vba/api/outlook.olresponsestatus
            switch (response)
            {
            case OlResponseStatus.olResponseNone:
                return("");

            case OlResponseStatus.olResponseOrganized:
                return("");

            case OlResponseStatus.olResponseTentative:
                return(I18n("RESPONSE") + ": " + I18n("TENTATIVELY") + I18n("ACCEPTED"));

            case OlResponseStatus.olResponseAccepted:
                return(I18n("RESPONSE") + ": " + I18n("ACCEPTED"));

            case OlResponseStatus.olResponseDeclined:
                return(I18n("RESPONSE") + ": " + I18n("DECLINED"));

            case OlResponseStatus.olResponseNotResponded:
                return(I18n("RESPONSE") + ": ?");
            }
            DPrint("no recognized OlResponseStatus", 0);
            return(I18n("RESPONSE") + ": ?");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the status.
        /// </summary>
        /// <param name="status">The status.</param>
        /// <returns>The status string.</returns>
        public static string GetStatus(this OlResponseStatus status)
        {
            switch (status)
            {
            case OlResponseStatus.olResponseAccepted:
                return(EventEntry.EventStatus.CONFIRMED_VALUE);

            case OlResponseStatus.olResponseDeclined:
                return(EventEntry.EventStatus.CANCELED_VALUE);

            case OlResponseStatus.olResponseTentative:
                return(EventEntry.EventStatus.TENTATIVE_VALUE);
            }

            return(EventEntry.EventStatus.TENTATIVE_VALUE);
        }
Exemplo n.º 4
0
        public Attendee(string email, AttendeeType type, string responseStatus)
        {
            this.Email    = email;
            this.Required = type == AttendeeType.Required;
            switch (responseStatus)
            {
            case "accepted":
                this.Status = OlResponseStatus.olResponseAccepted;
                break;

            case "declined":
                this.Status = OlResponseStatus.olResponseDeclined;
                break;

            case "tentative":
                this.Status = OlResponseStatus.olResponseTentative;
                break;

            default:
                this.Status = OlResponseStatus.olResponseNotResponded;
                break;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Convert invitee response status from Outlook to Google
        /// </summary>
        /// <param name="outlookStatus"></param>
        /// <returns></returns>
        internal static string GoogleResponseStatus(OlResponseStatus outlookStatus)
        {
            string status;

            switch (outlookStatus)
            {
            case OlResponseStatus.olResponseAccepted:
                status = "accepted";
                break;

            case OlResponseStatus.olResponseDeclined:
                status = "declined";
                break;

            case OlResponseStatus.olResponseTentative:
                status = "tentative";
                break;

            default:
                status = "needsAction";
                break;
            }
            return(status);
        }
Exemplo n.º 6
0
 internal Attendee(string email, int type, OlResponseStatus status)
 {
     this.Email    = email;
     this.Required = (OlMeetingRecipientType)type == OlMeetingRecipientType.olRequired;
     this.Status   = status;
 }