/// <summary>
 /// ServiceObjectPropertyException Constructor.
 /// </summary>
 /// <param name="message">Error message text.</param>
 /// <param name="propertyDefinition">The definition of the property that is at the origin of the exception.</param>
 /// <param name="innerException">Inner exception.</param>
 public ServiceObjectPropertyException(
     string message,
     PropertyDefinitionBase propertyDefinition,
     Exception innerException)
     : base(message, propertyDefinition.GetPrintableName(), innerException)
 {
     this.propertyDefinition = propertyDefinition;
 }
 /// <summary>
 /// ServiceObjectPropertyException constructor.
 /// </summary>
 /// <param name="propertyDefinition">The definition of the property that is at the origin of the exception.</param>
 public ServiceObjectPropertyException(PropertyDefinitionBase propertyDefinition)
     : base(propertyDefinition.GetPrintableName())
 {
     this.propertyDefinition = propertyDefinition;
 }
 /// <summary>
 /// ServiceObjectPropertyException constructor.
 /// </summary>
 /// <param name="propertyDefinition">The definition of the property that is at the origin of the exception.</param>
 public ServiceObjectPropertyException(PropertyDefinitionBase propertyDefinition)
     : base(propertyDefinition.GetPrintableName())
 {
     this.propertyDefinition = propertyDefinition;
 }
 /// <summary>
 /// ServiceObjectPropertyException Constructor.
 /// </summary>
 /// <param name="message">Error message text.</param>
 /// <param name="propertyDefinition">The definition of the property that is at the origin of the exception.</param>
 public ServiceObjectPropertyException(string message, PropertyDefinitionBase propertyDefinition)
     : base(message, propertyDefinition.GetPrintableName())
 {
     this.propertyDefinition = propertyDefinition;
 }
        /// <summary>
        /// Adds the specified property definition / sort direction pair to the collection.
        /// </summary>
        /// <param name="propertyDefinition">The property definition.</param>
        /// <param name="sortDirection">The sort direction.</param>
        public void Add(PropertyDefinitionBase propertyDefinition, SortDirection sortDirection)
        {
            if (this.Contains(propertyDefinition))
            {
                throw new ServiceLocalException(string.Format(Strings.PropertyAlreadyExistsInOrderByCollection, propertyDefinition.GetPrintableName()));
            }

            this.propDefSortOrderPairList.Add(new PropertyDefinitionSortDirectionPair(propertyDefinition, sortDirection));
        }