/// <summary>
 /// Raises the <see cref="AddingNew"/> event.
 /// </summary>
 /// <param name="e">The <see cref="System.ComponentModel.AddingNewEventArgs"/> instance containing the event data.</param>
 protected virtual void OnAddingNew(ObservableSupport.AddingNewEventArgs e)
 {
     ObservableSupport.AddingNewEventHandler handler = AddingNew;
     if (handler != null)
     {
         handler(this, e);
     }
 }
        object IBindingList.AddNew()
        {
            var args = new ObservableSupport.AddingNewEventArgs();

            OnAddingNew(args);

            if (args.NewObject == null)
            {
                throw new Exception("Could not determine new value to add to '{0}'.".FormatWith(CultureInfo.InvariantCulture, GetType()));
            }

            if (!(args.NewObject is JToken))
            {
                throw new Exception("New item to be added to collection must be compatible with {0}.".FormatWith(CultureInfo.InvariantCulture, typeof(JToken)));
            }

            JToken newItem = (JToken)args.NewObject;

            Add(newItem);

            return(newItem);
        }