Exemplo n.º 1
0
 internal static PreviewItemBaseShape GetBaseShape(PreviewItemBaseShape baseShape)
 {
     if (baseShape == PreviewItemBaseShape.Compact)
     {
         return(1);
     }
     return(0);
 }
Exemplo n.º 2
0
        internal static PreviewItemResponseShape GetPreviewItemResponseShape(PreviewItemBaseShape baseShape, List <ExtendedPropertyInfo> additionalProperties)
        {
            if (baseShape == PreviewItemBaseShape.Default && (additionalProperties == null || additionalProperties.Count == 0))
            {
                return(null);
            }
            PreviewItemResponseShape previewItemResponseShape = new PreviewItemResponseShape
            {
                BaseShape = DiscoveryEwsClient.GetBaseShape(baseShape)
            };
            int num = 0;

            if (additionalProperties != null)
            {
                previewItemResponseShape.AdditionalProperties = new ExtendedPropertyDefinition[additionalProperties.Count];
                num = additionalProperties.Count;
            }
            for (int i = 0; i < num; i++)
            {
                ExtendedPropertyDefinition extendedPropertyDefinition = DiscoveryEwsClient.ConvertExtendedPropertyInfoToExtendedPropertyDefinition(additionalProperties[i]);
                previewItemResponseShape.AdditionalProperties[i] = extendedPropertyDefinition;
            }
            return(previewItemResponseShape);
        }
Exemplo n.º 3
0
 public PagingInfo(List <PropertyDefinition> data, SortBy sort, int pageSize, PageDirection direction, ReferenceItem referenceItem, ExTimeZone timeZone, bool excludeDuplicatesItems, PreviewItemBaseShape baseShape, List <ExtendedPropertyInfo> additionalProperties)
 {
     Util.ThrowOnNull(data, "data");
     Util.ThrowOnNull(sort, "sort");
     if (pageSize == 0)
     {
         throw new ArgumentException("Page size cannot be 0");
     }
     if (referenceItem == null && direction == PageDirection.Previous)
     {
         throw new ArgumentException("PagingInfo: Have to provide sort column value to view previous page");
     }
     if (!PagingInfo.ValidateDataColumns(data))
     {
         throw new ArgumentException("PagingInfo: Invalid data columns");
     }
     this.originalDataColumns = data;
     this.dataColumns         = new List <PropertyDefinition>(data);
     this.sort                  = sort;
     this.referenceItem         = referenceItem;
     this.direction             = direction;
     this.pageSize              = pageSize;
     this.timeZone              = timeZone;
     this.excludeDuplicateItems = excludeDuplicatesItems;
     this.baseShape             = baseShape;
     this.additionalProperties  = additionalProperties;
     if (!this.originalDataColumns.Contains(sort.ColumnDefinition))
     {
         this.dataColumns.Add(sort.ColumnDefinition);
     }
     foreach (PropertyDefinition item in PagingInfo.RequiredDataPropertiesFromStore)
     {
         if (!this.originalDataColumns.Contains(item))
         {
             this.dataColumns.Add(item);
         }
     }
     if (this.additionalProperties != null)
     {
         foreach (ExtendedPropertyInfo extendedPropertyInfo in this.additionalProperties)
         {
             if (extendedPropertyInfo.XsoPropertyDefinition != null && !this.dataColumns.Contains(extendedPropertyInfo.XsoPropertyDefinition))
             {
                 this.dataColumns.Add(extendedPropertyInfo.XsoPropertyDefinition);
             }
         }
     }
     this.sorts = new SortBy[]
     {
         sort,
         new SortBy(ItemSchema.DocumentId, SortOrder.Ascending)
     };
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="baseShape">Preview item base shape</param>
 /// <param name="additionalProperties">Additional properties (must be in form of extended properties)</param>
 public PreviewItemResponseShape(PreviewItemBaseShape baseShape, ExtendedPropertyDefinition[] additionalProperties)
 {
     this.BaseShape = baseShape;
     this.AdditionalProperties = additionalProperties;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="baseShape">Preview item base shape</param>
 /// <param name="additionalProperties">Additional properties (must be in form of extended properties)</param>
 public PreviewItemResponseShape(PreviewItemBaseShape baseShape, ExtendedPropertyDefinition[] additionalProperties)
 {
     this.BaseShape            = baseShape;
     this.AdditionalProperties = additionalProperties;
 }