public static void MapCustomProperties1To2(GenericComObjectWrapper <UserProperties> userPropertiesWrapper, ICalendarPropertyList targetProperties, bool mapAllCustomProperties, PropertyMapping[] mappings, IEntityMappingLogger logger, ILog s_logger)
 {
     if (userPropertiesWrapper.Inner != null && userPropertiesWrapper.Inner.Count > 0)
     {
         foreach (var prop in userPropertiesWrapper.Inner.ToSafeEnumerable <UserProperty>())
         {
             try
             {
                 if (prop.Value != null && !string.IsNullOrEmpty(prop.Value.ToString()) && (prop.Type == OlUserPropertyType.olText))
                 {
                     var foundMapping = mappings.FirstOrDefault(m => m.OutlookProperty == prop.Name);
                     if (foundMapping != null)
                     {
                         targetProperties.Add(new CalendarProperty(foundMapping.DavProperty, prop.Value.ToString()));
                     }
                     else if (mapAllCustomProperties)
                     {
                         targetProperties.Add(new CalendarProperty("X-CALDAVSYNCHRONIZER-" + prop.Name, prop.Value.ToString()));
                     }
                 }
             }
             catch (COMException ex)
             {
                 s_logger.Warn("Can't access UserProperty of Item!", ex);
                 logger.LogMappingWarning("Can't access UserProperty of Item!", ex);
             }
         }
     }
 }
示例#2
0
        public void Add(CalendarPropertyInstance calendarProperty)
        {
            if (calendarProperty == null)
            {
                throw new JavaScriptException(this.Engine, "Error", "calendarProperty argument cannot be null.");
            }

            m_calendarPropertyList.Add(calendarProperty.CalendarProperty);
        }
 public static void MapCustomProperties1To2 (GenericComObjectWrapper<UserProperties> userPropertiesWrapper, ICalendarPropertyList targetProperties, bool mapAllCustomProperties, PropertyMapping[] mappings, IEntityMappingLogger logger, ILog s_logger)
 {
   if (userPropertiesWrapper.Inner != null && userPropertiesWrapper.Inner.Count > 0)
   {
     foreach (var prop in userPropertiesWrapper.Inner.ToSafeEnumerable<UserProperty>())
     {
       try
       {
         if (prop.Value != null && !string.IsNullOrEmpty (prop.Value.ToString()) && (prop.Type == OlUserPropertyType.olText))
         {
           var foundMapping = mappings.FirstOrDefault (m => m.OutlookProperty == prop.Name);
           if (foundMapping != null)
           {
             targetProperties.Add (new CalendarProperty (foundMapping.DavProperty, prop.Value.ToString()));
           }
           else if (mapAllCustomProperties)
           {
             targetProperties.Add (new CalendarProperty ("X-CALDAVSYNCHRONIZER-" + prop.Name, prop.Value.ToString()));
           }
         }
       }
       catch (COMException ex)
       {
         s_logger.Warn ("Can't access UserProperty of Item!", ex);
         logger.LogMappingWarning ("Can't access UserProperty of Item!", ex);
       }
     }
   }
 }