public static string MapPrivacy1To2 (OlSensitivity value, bool mapPrivateToConfidential)
 {
   switch (value)
   {
     case OlSensitivity.olNormal:
       return "PUBLIC";
     case OlSensitivity.olPersonal:
       return "PRIVATE"; // not sure
     case OlSensitivity.olPrivate:
       return mapPrivateToConfidential ? "CONFIDENTIAL" : "PRIVATE";
     case OlSensitivity.olConfidential:
       return "CONFIDENTIAL";
   }
   throw new NotImplementedException (string.Format ("Mapping for value '{0}' not implemented.", value));
 }
Пример #2
0
        /// <summary>
        /// Gets the status.
        /// </summary>
        /// <param name="status">The status.</param>
        /// <returns>The visibility string.</returns>
        public static string GetStatus(this OlSensitivity status)
        {
            switch (status)
            {
            case OlSensitivity.olNormal:
                return(EventEntry.Visibility.DEFAULT_VALUE);

            case OlSensitivity.olPrivate:
                return(EventEntry.Visibility.PRIVATE_VALUE);

            case OlSensitivity.olConfidential:
                return(EventEntry.Visibility.CONFIDENTIAL_VALUE);
            }

            return(EventEntry.Visibility.DEFAULT_VALUE);
        }
Пример #3
0
        ///// <summary>
        ///// Convert any calendar event to Google's Event
        ///// </summary>
        ///// <param name="calendarEvent"></param>
        ///// <returns></returns>
        //internal static Event Google(CalendarEvent calendarEvent)
        //{
        //    return calendarEvent.ToGoogle();
        //}

        ///// <summary>
        ///// Convert any calendar event to Outlook's AppointmentItem
        ///// </summary>
        ///// <param name="calendarEvent"></param>
        ///// <returns></returns>
        //internal static AppointmentItem Outlook(CalendarEvent calendarEvent)
        //{
        //    return calendarEvent.ToOutlook();
        //}

        /// <summary>
        /// Converts Outlook item privacy/sensitivity/visibility setting to Google one
        /// </summary>
        /// <param name="olSensitivity"></param>
        /// <returns></returns>
        internal static string GoogleVisibility(OlSensitivity outlookVisibility)
        {
            switch (outlookVisibility)
            {
            case OlSensitivity.olNormal:
                return("default");

            case OlSensitivity.olPrivate:
                return("private");

            case OlSensitivity.olConfidential:
                return("confidential");

            default:
                return("public");
            }
        }
        public static string MapPrivacy1To2(OlSensitivity value)
        {
            switch (value)
            {
            case OlSensitivity.olNormal:
                return("normal");

            case OlSensitivity.olPersonal:
                return("personal");

            case OlSensitivity.olPrivate:
                return("private");

            case OlSensitivity.olConfidential:
                return("confidential");
            }
            throw new NotImplementedException(string.Format("Mapping for value '{0}' not implemented.", value));
        }
        private vCardAccessClassification MapPrivacy1To2(OlSensitivity value)
        {
            switch (value)
            {
            case OlSensitivity.olNormal:
                return(vCardAccessClassification.Public);

            case OlSensitivity.olPersonal:
                return(vCardAccessClassification.Private);

            case OlSensitivity.olPrivate:
                return(vCardAccessClassification.Private);

            case OlSensitivity.olConfidential:
                return(vCardAccessClassification.Confidential);
            }
            throw new NotImplementedException(string.Format("Mapping for value '{0}' not implemented.", value));
        }
        public static string MapPrivacy1To2(OlSensitivity value, bool mapPrivateToConfidential)
        {
            switch (value)
            {
            case OlSensitivity.olNormal:
                return("PUBLIC");

            case OlSensitivity.olPersonal:
                return("PRIVATE"); // not sure

            case OlSensitivity.olPrivate:
                return(mapPrivateToConfidential ? "CONFIDENTIAL" : "PRIVATE");

            case OlSensitivity.olConfidential:
                return("CONFIDENTIAL");
            }
            throw new NotImplementedException(string.Format("Mapping for value '{0}' not implemented.", value));
        }