public void FromPropertyValues(IDictionary <Microsoft.Exchange.Data.PropertyDefinition, int> propertyIndices, IList values, IEvent right)
        {
            object calendarItemTypeValue;
            Func <CalendarItemType> getCalendarItemType = delegate()
            {
                if (!this.TryGetPropertyFromPropertyIndices(propertyIndices, values, EventTypeTranslationRule.CalendarItemTypeProperty, out calendarItemTypeValue))
                {
                    return(CalendarItemType.Single);
                }
                return((CalendarItemType)calendarItemTypeValue);
            };
            object        itemClass;
            Func <string> getItemClass = delegate()
            {
                if (!this.TryGetPropertyFromPropertyIndices(propertyIndices, values, EventTypeTranslationRule.ItemClass, out itemClass))
                {
                    return(null);
                }
                return((string)itemClass);
            };
            object        seriesId;
            Func <string> getSeriesId = delegate()
            {
                if (!this.TryGetPropertyFromPropertyIndices(propertyIndices, values, EventTypeTranslationRule.NprSeriesId, out seriesId))
                {
                    return(null);
                }
                return((string)seriesId);
            };

            right.Type = EventTypeTranslationRule.GetEventType(getCalendarItemType, getItemClass, getSeriesId);
        }
 public void FromLeftToRightType(ICalendarItemBase left, IEvent right)
 {
     right.Type = EventTypeTranslationRule.GetEventType(() => left.CalendarItemType, () => left.ItemClass, () => left.SeriesId);
 }