/// <summary> /// Convert Outlook free/busy status to Google's one. /// In fact Google has just two statuses: free and busy. /// Therefore OlBusyStatus.olFree will be converted to Google's free /// and rest will be converted to Google's busy /// </summary> /// <param name="outlookBusyStatus"></param> /// <returns></returns> internal static string GoogleAvailability(OlBusyStatus outlookBusyStatus) { switch (outlookBusyStatus) { case OlBusyStatus.olFree: return("transparent"); default: return("opaque"); } }
/// <summary> /// Gets the status. /// </summary> /// <param name="status">The status.</param> /// <returns>The status string.</returns> public static string GetStatus(this OlBusyStatus status) { switch (status) { case OlBusyStatus.olFree: case OlBusyStatus.olTentative: return(EventEntry.Transparency.TRANSPARENT_VALUE); case OlBusyStatus.olBusy: case OlBusyStatus.olOutOfOffice: return(EventEntry.Transparency.OPAQUE_VALUE); } return(EventEntry.Transparency.OPAQUE_VALUE); }
public static void SetBusyStatus(this Appointment calendarAppointment, OlBusyStatus busyStatus) { if (busyStatus == OlBusyStatus.olBusy) { calendarAppointment.BusyStatus = BusyStatusEnum.Busy; } else if (busyStatus == OlBusyStatus.olFree) { calendarAppointment.BusyStatus = BusyStatusEnum.Free; } else if (busyStatus == OlBusyStatus.olOutOfOffice) { calendarAppointment.BusyStatus = BusyStatusEnum.OutOfOffice; } else if (busyStatus == OlBusyStatus.olTentative) { calendarAppointment.BusyStatus = BusyStatusEnum.Tentative; } }
/// <summary> /// Translates a <see cref="OlBusyStatus"/> into a <see cref="BusyStatus"/>. /// </summary> /// <param name="status"> /// The <see cref="OlBusyStatus"/> to translate into a <see cref="BusyStatus"/>. /// </param> /// <returns> /// The corresponding <see cref="BusyStatus"/>. /// </returns> /// <exception cref="ArgumentOutOfRangeException"> /// In case of an unknown <see cref="OlBusyStatus"/>. /// </exception> public static BusyStatus ToBusyStatus(this OlBusyStatus status) { switch (status) { case OlBusyStatus.olFree: return(BusyStatus.Free); case OlBusyStatus.olBusy: return(BusyStatus.Busy); case OlBusyStatus.olOutOfOffice: return(BusyStatus.OutOfOffice); case OlBusyStatus.olTentative: return(BusyStatus.Tentative); default: throw new ArgumentOutOfRangeException("status", status, Resources.NoValueTranslationMessage); } }
private static string GetBusyStatusString(OlBusyStatus busyStatus) { switch (busyStatus) { case OlBusyStatus.olBusy: return("Busy"); case OlBusyStatus.olFree: return("Free"); case OlBusyStatus.olOutOfOffice: return("Out of office"); case OlBusyStatus.olTentative: return("Tentative"); case OlBusyStatus.olWorkingElsewhere: return("Working elsewhere"); } return("Unknown"); }
private bool BusyStatus(OlBusyStatus status) { return status == OlBusyStatus.olBusy || status == OlBusyStatus.olTentative; }