Exemplo n.º 1
0
 public void Call(object param0, Newtonsoft.Json.ObservableSupport.AddingNewEventArgs param1)
 {
     func.BeginPCall();
     func.Push(param0);
     func.PushObject(param1);
     func.PCall();
     func.EndPCall();
 }
Exemplo n.º 2
0
        /// <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(AddingNewEventArgs e)
        {
            AddingNewEventHandler handler = AddingNew;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 3
0
        object IBindingList.AddNew()
        {
            Newtonsoft.Json.ObservableSupport.AddingNewEventArgs addingNewEventArgs = new Newtonsoft.Json.ObservableSupport.AddingNewEventArgs();
            OnAddingNew(addingNewEventArgs);
            if (addingNewEventArgs.NewObject == null)
            {
                throw new Exception("Could not determine new value to add to '{0}'.".FormatWith(CultureInfo.InvariantCulture, GetType()));
            }
            if (!(addingNewEventArgs.NewObject is JToken))
            {
                throw new Exception("New item to be added to collection must be compatible with {0}.".FormatWith(CultureInfo.InvariantCulture, typeof(JToken)));
            }
            JToken jToken = (JToken)addingNewEventArgs.NewObject;

            Add(jToken);
            return(jToken);
        }
Exemplo n.º 4
0
        object IBindingList.AddNew()
        {
            AddingNewEventArgs args = new 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);
        }
Exemplo n.º 5
0
 protected virtual void OnAddingNew(Newtonsoft.Json.ObservableSupport.AddingNewEventArgs e)
 {
     this.AddingNew?.Invoke(this, e);
 }