/// <summary> /// Create new instance of <see cref="FindItemsResults{TItem}"/>. /// </summary> /// <param name="entityResponseCollection">Response collection.</param> internal FindItemsResults(EntityResponseCollection <TItem> entityResponseCollection, ExchangeService exchangeService, MailboxId mailboxId) : base(entityResponseCollection) { if (this.Items != null) { foreach (TItem item in this.Items) { item.Service = exchangeService; item.MailboxId = mailboxId; item.ResetChangeTracking(); } } }
/// <summary> /// Create new instance of <see cref="ChangeResults{TItem}"/>. /// </summary> /// <param name="entityResponseCollection">Response collection.</param> protected ChangeResults(EntityResponseCollection <TItem> entityResponseCollection) { // In case of nulls we want to make sure null ref isn't thrown. if (entityResponseCollection == null) { entityResponseCollection = new EntityResponseCollection <TItem>(); entityResponseCollection.Value = new List <TItem>(0); } this.changeItems = new List <ItemChange <TItem> >(entityResponseCollection.Value.Count); foreach (TItem item in entityResponseCollection.Value) { this.changeItems.Add(new ItemChange <TItem>(item)); } this.MoreAvailable = entityResponseCollection.MoreAvailable; }
/// <summary> /// Create new instance of <see cref="FindResults{TItem}"/>. /// </summary> /// <param name="entityResponseCollection">Response collection.</param> protected FindResults(EntityResponseCollection <TItem> entityResponseCollection) { if (entityResponseCollection == null) { // to prevent null refs. this.entityResponseCollection = new EntityResponseCollection <TItem>(); this.entityResponseCollection.Value = new List <TItem>(); } else { this.entityResponseCollection = entityResponseCollection; } if (null == this.entityResponseCollection.Value) { // prevent nullrefs this.entityResponseCollection.Value = new List <TItem>(); } }
/// <summary> /// Create new instance of <see cref="FindFoldersResults"/> /// </summary> /// <param name="entityResponseCollection"></param> internal FindFoldersResults(EntityResponseCollection <MailFolder> entityResponseCollection) : base(entityResponseCollection) { }