Example #1
0
 /// <summary>
 /// Determines whether two ServiceId instances are equal (including ChangeKeys)
 /// </summary>
 /// <param name="other">The ServiceId to compare with the current ServiceId.</param>
 public bool SameIdAndChangeKey(ServiceId other)
 {
     if (this.Equals(other))
     {
         return(((this.ChangeKey == null) && (other.ChangeKey == null)) ||
                this.ChangeKey.Equals(other.ChangeKey));
     }
     else
     {
         return(false);
     }
 }
Example #2
0
        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
        /// <remarks>
        /// We do not consider the ChangeKey for ServiceId.Equals.</remarks>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">The <paramref name="obj"/> parameter is null.</exception>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            else
            {
                ServiceId other = obj as ServiceId;

                if (other == null)
                {
                    return(false);
                }
                else if (!(this.IsValid && other.IsValid))
                {
                    return(false);
                }
                else
                {
                    return(this.UniqueId.Equals(other.UniqueId));
                }
            }
        }
Example #3
0
 /// <summary>
 /// Assigns from existing id.
 /// </summary>
 /// <param name="source">The source.</param>
 internal void Assign(ServiceId source)
 {
     this.uniqueId  = source.UniqueId;
     this.changeKey = source.ChangeKey;
 }
        private static IEnumerable<Attendee> GetAtendees(ExchangeService service, ServiceId serviceId)
        {
            var result = service.BindToItems(new[] {new ItemId(serviceId.UniqueId)},
                                             new PropertySet(BasePropertySet.FirstClassProperties)).SingleOrDefault();

            var appointment = (Appointment) result.Item;

            // TODO re factor attendee creation to remove code duplication
            return appointment.RequiredAttendees.Select(a => new Attendee {
                Name = a.Name,
                ResponseType = a.ResponseType.ToString()
            });
        }
Example #5
0
 /// <summary>
 /// Assigns from existing id.
 /// </summary>
 /// <param name="source">The source.</param>
 internal void Assign(ServiceId source)
 {
     this.uniqueId = source.UniqueId;
     this.changeKey = source.ChangeKey;
 }
Example #6
0
 /// <summary>
 /// Determines whether two ServiceId instances are equal (including ChangeKeys)
 /// </summary>
 /// <param name="other">The ServiceId to compare with the current ServiceId.</param>
 public bool SameIdAndChangeKey(ServiceId other)
 {
     if (this.Equals(other))
     {
         return ((this.ChangeKey == null) && (other.ChangeKey == null)) ||
                this.ChangeKey.Equals(other.ChangeKey);
     }
     else
     {
         return false;
     }
 }