+2008-10-17 Mario Carrion <mcarrion@novell.com>
+
+ * ComboBox.cs, ListBox.cs: Using added/removed item in
+ OnUIACollectionChangedEvent instead of index.
+
2008-10-17 Jonathan Pobst <monkey@jpobst.com>
* ComboBox.cs: When we are sorting the items, if the item's type
get { return textbox_ctrl; }
}
+ internal ListBox UIAListBox {
+ get { return listbox_ctrl; }
+ }
+
#endregion UIA Framework Properties
#region Public Methods
#if NET_2_0
//UIA Framework event: Item Removed
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, object_items [index]));
#endif
object_items[index] = value;
#if NET_2_0
//UIA Framework event: Item Added
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, value));
#endif
if (owner.listbox_ctrl != null)
#if NET_2_0
//UIA Framework event: Items list cleared
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, -1));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, null));
#endif
}
object_items.Insert (index, item);
#if NET_2_0
//UIA Framework event: Item added
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, item));
#endif
}
if (index == owner.SelectedIndex)
owner.SelectedIndex = -1;
+#if NET_2_0
+ object removed = object_items [index];
+#endif
+
+
object_items.RemoveAt (index);
owner.UpdatedItems ();
#if NET_2_0
//UIA Framework event: Item removed
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, removed));
#endif
}
#endregion Public Methods
#if NET_2_0
//UIA Framework event: Item added
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, item));
#endif
return index;
#if NET_2_0
//UIA Framework event: Item added
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, object_items.Count - 1));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, item));
#endif
return object_items.Count - 1;
-// Permission is hereby granted, free of charge, to any person obtaining
+/// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
#if NET_2_0
//UIA Framework event: Item Removed
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, object_items [index]));
#endif
object_items[index] = value;
#if NET_2_0
//UIA Framework event: Item Added
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, value));
#endif
owner.CollectionChanged ();
#if NET_2_0
//UIA Framework event: Items list cleared
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, -1));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, null));
#endif
}
#if NET_2_0
//UIA Framework event: Item Added
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, item));
#endif
}
if (index < 0 || index >= Count)
throw new ArgumentOutOfRangeException ("Index of out range");
+
+#if NET_2_0
+ //UIA Framework element removed
+ object removed = object_items [index];
+#endif
+
owner.selected_indices.Remove (index);
object_items.RemoveAt (index);
owner.CollectionChanged ();
#if NET_2_0
//UIA Framework event: Item Removed
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Remove, removed));
#endif
}
#endregion Public Methods
#if NET_2_0
//UIA Framework event: Item Added
- OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, cnt));
+ OnUIACollectionChangedEvent (new CollectionChangeEventArgs (CollectionChangeAction.Add, item));
#endif
return cnt;