public ListChangedEventArgs(ListChangedType listChangedType,
								int newIndex, int oldIndex)
			{
				this.listChangedType = listChangedType;
				this.newIndex = newIndex;
				this.oldIndex = oldIndex;
			}
		public ListChangedEventArgs (ListChangedType listChangedType,
					     PropertyDescriptor propDesc)
		{
			this.changedType = listChangedType;
#if NET_2_0
			this.propDesc = propDesc;
#endif			
		}
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, int oldIndex) {
     Debug.Assert(listChangedType != ListChangedType.PropertyDescriptorAdded, "this constructor is used only for item changed in the list");
     Debug.Assert(listChangedType != ListChangedType.PropertyDescriptorDeleted, "this constructor is used only for item changed in the list");
     Debug.Assert(listChangedType != ListChangedType.PropertyDescriptorChanged, "this constructor is used only for item changed in the list");
     this.listChangedType = listChangedType;
     this.newIndex = newIndex;
     this.oldIndex = oldIndex;
 }
Example #4
0
 /// <summary>
 /// Maintain the DataView before <see cref="DataView.ListChanged"/> is raised.
 /// </summary>
 internal void MaintainDataView(ListChangedType changedType, DataRow row, bool trackAddRemove) {
     DataView dv = (DataView)_dvWeak.Target;
     if (dv != null) {
         dv.MaintainDataView(changedType, row, trackAddRemove);
     }
     else {
         CleanUp(true);
     }
 }
Example #5
0
		public ListChangedEventArgs (ListChangedType listChangedType,
					     int newIndex,
					     PropertyDescriptor propDesc)
		{
			this.changedType = listChangedType;
			this.newIndex = newIndex;
			this.oldIndex = newIndex;
			this.propDesc = propDesc;
		}
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public ListChangedEventArgs(ListChangedType listChangedType, PropertyDescriptor propDesc) {
            Debug.Assert(listChangedType != ListChangedType.Reset, "this constructor is used only for changes in the list MetaData");
            Debug.Assert(listChangedType != ListChangedType.ItemAdded, "this constructor is used only for changes in the list MetaData");
            Debug.Assert(listChangedType != ListChangedType.ItemDeleted, "this constructor is used only for changes in the list MetaData");
            Debug.Assert(listChangedType != ListChangedType.ItemChanged, "this constructor is used only for changes in the list MetaData");

            this.listChangedType = listChangedType;
            this.propDesc = propDesc;
        }
 internal void MaintainDataView(ListChangedType changedType, DataRow row, bool trackAddRemove)
 {
     DataView target = (DataView) this._dvWeak.Target;
     if (target != null)
     {
         target.MaintainDataView(changedType, row, trackAddRemove);
     }
     else
     {
         this.CleanUp(true);
     }
 }
Example #8
0
 public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, PropertyDescriptor propDesc) : this(listChangedType, newIndex)
 {
     PropertyDescriptor = propDesc;
     OldIndex           = newIndex;
 }
Example #9
0
        private void OnListChanged(ListChangedType listchangedType, int newIndex, int oldIndex)
        {
            var changeArgs = new ListChangedEventArgs(listchangedType, newIndex, oldIndex);

            OnListChanged(changeArgs);
        }
 public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, int oldIndex)
 {
     this.ListChangedType = listChangedType;
     this.NewIndex        = newIndex;
     this.OldIndex        = oldIndex;
 }
Example #11
0
 // This method is used to fire ListChanged events when the inner list
 // is not an IBindingList (and therefore cannot fire them itself).
 //
 private void OnSimpleListChanged(ListChangedType listChangedType, int newIndex) {
     if (!isBindingList) {
         OnListChanged(new ListChangedEventArgs(listChangedType, newIndex));
     }
 }
Example #12
0
 ///<summary>
 /// GridDataBindingCompleteEventArgs
 ///</summary>
 ///<param name="gridPanel"></param>
 public GridDataBindingCompleteEventArgs(GridPanel gridPanel)
     : base(gridPanel)
 {
     _ListChangedType = ListChangedType.Reset;
 }
 public ListChangedEventArgs(ListChangedType listChangedType, PropertyDescriptor propDesc)
 {
     throw new NotImplementedException();
 }
Example #14
0
        internal void ChangedList(ListChangedType listChangedType, int newIndex, int oldIndex)
        {
            ListChangedEventArgs e = new ListChangedEventArgs(listChangedType, newIndex, oldIndex);

            OnListChanged(e);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="listChangedType"></param>
 /// <param name="propDesc"></param>
 public ListChangedEventArgs(ListChangedType listChangedType, System.ComponentModel.PropertyDescriptor propDesc)
 {
     this.listChangedType = listChangedType;
     this.propDesc = propDesc;
 }
Example #16
0
        public static void RemoveListChangedEventHandler(this FormCollection collection, ListChangedEventHandler eventHandler, ListChangedType changedType)
        {
            var innerListlistFieldInfo = collection.GetType().BaseType.GetField("list", fieldBindingFlags);
            var innerlist = innerListlistFieldInfo?.GetValue(Application.OpenForms);

            if (!(innerlist is ObservableArrayList))
            {
                var newInnerList = new ObservableArrayList();
                foreach (var item in innerlist as ArrayList)
                {
                    newInnerList.Add(item);
                }

                innerListlistFieldInfo.SetValue(Application.OpenForms, newInnerList);
            }

            if (innerListlistFieldInfo?.GetValue(Application.OpenForms) is ObservableArrayList currentInnerList)
            {
                switch (changedType)
                {
                case ListChangedType.Added:
                    currentInnerList.Added -= eventHandler;
                    break;

                case ListChangedType.Removed:
                    currentInnerList.Removed -= eventHandler;
                    break;
                }
            }
        }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventedList&lt;T&gt;.ListChangedEventArgs&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="type">The type of change.</param>
 /// <param name="item">The item that has changed.</param>
 /// <param name="itemIndex">Index of the changed item.</param>
 /// <param name="oldItem">The old item when an item has changed.</param>
 public ListChangedEventArgs(ListChangedType type, T item, int itemIndex, T oldItem)
     : this(type, item, itemIndex)
 {
     OldItem = oldItem;
 }
Example #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventedList&lt;T&gt;.ListChangedEventArgs&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="type">The type of change.</param>
 /// <param name="item">The item that has changed.</param>
 /// <param name="itemIndex">Index of the changed item.</param>
 public ListChangedEventArgs(ListChangedType type, T item, int itemIndex)
 {
     Item            = item;
     ItemIndex       = itemIndex;
     ListChangedType = type;
 }
Example #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventedList&lt;T&gt;.ListChangedEventArgs&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="type">The type of change.</param>
 public ListChangedEventArgs(ListChangedType type)
 {
     ItemIndex       = -1;
     ListChangedType = type;
 }
Example #20
0
 public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, int oldIndex)
 {
     ListChangedType = listChangedType;
     NewIndex        = newIndex;
     OldIndex        = oldIndex;
 }
		public EditableListChangedEventArgs(ListChangedType listChangedType)
			: base(listChangedType, -1)
		{
		}
 public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, int oldIndex)
 {
     throw new NotImplementedException();
 }
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public ListChangedEventArgs(ListChangedType listChangedType, int newIndex) : this(listChangedType, newIndex, -1) {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotifyListChangedEventArgs"/> class.
 /// </summary>
 /// <param name="listChangedType">Type of change.</param>
 public NotifyListChangedEventArgs(ListChangedType listChangedType)
     : base(listChangedType, -1)
 {
 }
Example #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventedList&lt;T&gt;.ListChangedEventArgs&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="type">The type of change.</param>
 /// <param name="item">The item that has changed.</param>
 /// <param name="itemIndex">Index of the changed item.</param>
 public ListChangedEventArgs(ListChangedType type, T item, int itemIndex)
 {
     this.Item            = item;
     this.ItemIndex       = itemIndex;
     this.ListChangedType = type;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotifyListChangedEventArgs"/> class.
 /// </summary>
 /// <param name="listChangedType">Type of change.</param>
 /// <param name="propDesc">The <see cref="PropertyDescriptor"/> that was added, removed, or changed.</param>
 public NotifyListChangedEventArgs(ListChangedType listChangedType, PropertyDescriptor propDesc)
     : base(listChangedType, propDesc)
 {
 }
Example #27
0
		internal void ChangedList(ListChangedType listChangedType, int newIndex,int oldIndex)
		{
			ListChangedEventArgs e = new ListChangedEventArgs(listChangedType,newIndex,oldIndex);
			OnListChanged(e);
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="NotifyListChangedEventArgs"/> class.
 /// </summary>
 /// <param name="listChangedType">Type of change.</param>
 /// <param name="newIndex">The index of the item that was added, changed, or removed.</param>
 /// <param name="newItem">The item that was added, changed, or removed.</param>
 public NotifyListChangedEventArgs(ListChangedType listChangedType, int newIndex, object newItem)
     : base(listChangedType, newIndex)
 {
     NewItem = newItem;
 }
Example #29
0
		protected void OnListChanged(ListChangedType listChangedType, int newIndex)
		{
			OnListChanged(new ListChangedEventArgs(listChangedType, newIndex));
		}
 /// <summary>
 /// Initializes a new instance of the <see cref="NotifyListChangedEventArgs"/> class.
 /// </summary>
 /// <param name="listChangedType">Type of change.</param>
 /// <param name="newIndex">The index of the item that was added or changed.</param>
 /// <param name="newItem">The item that was added, changed, or removed.</param>
 /// <param name="propDesc">The <see cref="PropertyDescriptor"/> describing the item.</param>
 public NotifyListChangedEventArgs(ListChangedType listChangedType, int newIndex, object newItem, PropertyDescriptor propDesc)
     : base(listChangedType, newIndex, propDesc)
 {
     NewItem = newItem;
 }
 virtual internal void OnUpdateViewNotification(object sender, ListChangedType changeType, esEntity obj)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NotifyListChangedEventArgs"/> class.
 /// </summary>
 /// <param name="listChangedType">Type of change.</param>
 /// <param name="newIndex">The new index of the item that was moved.</param>
 /// <param name="oldIndex">The old index of the item that was moved.</param>
 public NotifyListChangedEventArgs(ListChangedType listChangedType, int newIndex, int oldIndex)
     : base(listChangedType, newIndex, oldIndex)
 {
 }
Example #33
0
 public ListChangedEventArgs(ListChangedType listChangedType, int newIndex) : this(listChangedType, newIndex, -1)
 {
 }
Example #34
0
 protected internal virtual void FireListChanged(ListChangedType type, int index)
 {
 }
Example #35
0
 public ListChangedEventArgs(ListChangedType listChangedType, PropertyDescriptor propDesc)
 {
     ListChangedType    = listChangedType;
     PropertyDescriptor = propDesc;
 }
 public void FireChangedEvent(ListChangedType changeType, int index)
 {
     OnListChanged(new ListChangedEventArgs(changeType, index));
 }
		public EditableListChangedEventArgs(ListChangedType listChangedType, int index)
			: base(listChangedType, index)
		{
		}
Example #38
0
 public ListBindingCompleteEventArgs(ListChangedType listChangedType)
 {
     this.listChangedType = listChangedType;
 }
Example #39
0
 protected void NotifyListChanged(ListChangedType type, int index)
 {
 }
Example #40
0
        //---------------------------------------------------------------------
        #region ** notification mechanism

        protected void OnListChanged(ListChangedType change)
        {
            OnListChanged(change, -1);
        }
		private void OnListChanged(ListChangedType action, int index)
		{
			if (ListChanged != null)
				ListChanged(this, new ListChangedEventArgs(action, index));
		}
		/// <summary>
		/// Raises the System.Data.DataView.ListChanged event.
		/// </summary>
		/// <param name="listChangedType">The type of change.</param>
		/// <param name="newIndex">The index of the row affected by the change.</param>
		/// <param name="oldIndex">The previous index of the row.</param>
		/// <remarks>Used when moving a row.</remarks>
		protected void OnListChanged(ListChangedType listChangedType, int newIndex, int oldIndex)
		{
			if (_defaultItem != null)
			{
				newIndex++;
				oldIndex++;
			}

			if (ListChanged != null)
				this.ListChanged(this, new ListChangedEventArgs(listChangedType, newIndex, oldIndex));
		}
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, PropertyDescriptor propDesc) : this(listChangedType, newIndex) {
     this.propDesc = propDesc;
     this.oldIndex = newIndex;
 }
 internal void OnDataBindingComplete(ListChangedType listChangedType)
 {
     OnDataBindingComplete(new DataGridViewBindingCompleteEventArgs(listChangedType));
 }
Example #45
0
 protected void OnListChanged(ListChangedType listChangedType, int index)
 {
     OnListChanged(new EditableListChangedEventArgs(listChangedType, index));
 }
Example #46
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventedList&lt;T&gt;.ListChangedEventArgs&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="type">The type of change.</param>
 public ListChangedEventArgs(ListChangedType type)
 {
     this.ItemIndex       = -1;
     this.ListChangedType = type;
 }
		/// <summary>
		/// Raises the System.Data.DataView.ListChanged event.
		/// </summary>
		/// <param name="listChangedType">The type of change.</param>
		/// <param name="newIndex">The index of the row affected by the change.</param>
		/// <param name="propDesc">The property that changed on the row.</param>
		/// <remarks>Used when a change in the row is caused by a changing property.</remarks>
		protected void OnListChanged(ListChangedType listChangedType, int newIndex, PropertyDescriptor propDesc)
		{
			if (_defaultItem != null)
				newIndex++;

			if (ListChanged != null)
				this.ListChanged(this, new ListChangedEventArgs(listChangedType, newIndex, propDesc));
		}
Example #48
0
 public ListChangingEventArgs(ListChangedType listChangedType, object changingObject, int changingIndex)
 {
     ListChangedType = listChangedType;
     ChangingObject  = changingObject;
     ChangingIndex   = changingIndex;
 }
 /// <summary>Creates a new <see cref="BplListChangedEventArgs"/> instance with type of change, the item affected,
 /// and the old and new index of the affected item.</summary>
 public BplListChangedEventArgs(ListChangedType changeType, object item, int newIndex, int oldIndex)
    : base(changeType, newIndex, oldIndex) {
    Item = item;
 }
Example #50
0
 public ListChangedEventArgs(ListChangedType type, EditedObject <T> obj)
 {
     EditedObject    = obj;
     ListChangedType = type;
 }
		public DataGridViewBindingCompleteEventArgs (ListChangedType listChangedType) {
			this.listChangedType = listChangedType;
		}
	public ListChangedEventArgs(ListChangedType listChangedType,
								PropertyDescriptor propDesc)
			{
				this.listChangedType = listChangedType;
				this.propDesc = propDesc;
			}
Example #53
0
 public EntityListBaseChangedEventArgs(ListChangedType type, object item)
 {
     this.type = type;
     this.item = item;
 }
Example #54
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotifyListChangedEventArgs"/> class.
        /// </summary>
        /// <param name="listChangedType">Type of change.</param>
        /// <param name="newIndex">The new index of the item that was moved.</param>
        /// <param name="oldIndex">The old index of the item that was moved.</param>
        public NotifyListChangedEventArgs(ListChangedType listChangedType, int newIndex, int oldIndex)
            : base(listChangedType, newIndex, oldIndex)
        {

        }
		protected void OnListChanged(ListChangedType listChangedType, int index)
		{
			OnListChanged(new EditableListChangedEventArgs(listChangedType, index));
		}
 /// <summary>
 /// Invokes the <see cref="ListChanged"/> event.
 /// </summary>
 /// <param name="listChangeType">Specifies how the list changed.</param>
 /// <param name="newIndex">The index of the changed item.</param>
 public virtual void OnListChanged(ListChangedType listChangeType, int newIndex)
 {
     if (ListChanged != null)
         ListChanged(this, new ListChangedEventArgs(listChangeType, newIndex));
 }
 public void FireChangedEvent(ListChangedType changeType, int index)
 {
     OnListChanged(new ListChangedEventArgs(changeType, index));
 }
	public ListChangedEventArgs(ListChangedType listChangedType, PropertyDescriptor propDesc) {}
 internal virtual void OnUpdateViewNotification(object sender, ListChangedType changeType, tgEntity obj)
 {
 }
	public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, int oldIndex) {}