/// <summary>
 /// Initializes a new instance of the <see cref="ReferenceAttachment"/> class.
 /// </summary>
 /// <param name="owner">The owner.</param>
 internal ReferenceAttachment(Item owner)
     : base(owner)
 {
     EwsUtilities.ValidateClassVersion(
         this.Owner.Service,
         ExchangeVersion.Exchange2015,
         this.GetType().Name);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="StreamingSubscriptionConnection"/> class.
        /// </summary>
        /// <param name="service">The ExchangeService instance this connection uses to connect to the server.</param>
        /// <param name="lifetime">The maximum time, in minutes, the connection will remain open. Lifetime must be between 1 and 30.</param>
        public StreamingSubscriptionConnection(
            ExchangeService service,
            int lifetime)
        {
            EwsUtilities.ValidateParam(service, "service");

            EwsUtilities.ValidateClassVersion(
                service,
                ExchangeVersion.Exchange2010_SP1,
                this.GetType().Name);

            if (lifetime < 1 || lifetime > 30)
            {
                throw new ArgumentOutOfRangeException("lifetime");
            }

            this.session           = service;
            this.subscriptions     = new Dictionary <string, StreamingSubscription>();
            this.connectionTimeout = lifetime;
        }