Пример #1
0
        public ListItemProvider RemoveItemFrom(object objectItem)
        {
            ListItemProvider item = null;

            if (items.TryGetValue(objectItem, out item) == true)
            {
                items.Remove(objectItem);
                item.Terminate();
            }

            return(item);
        }
Пример #2
0
        private void OnUIACollectionChanged(object sender, CollectionChangeEventArgs args)
        {
            if (lastCurrencyManager == null || args.Action == CollectionChangeAction.Refresh)
            {
                return;
            }

            // FIXME: Remove CurrentTableStyle property after committing SWF patch
            SWF.DataGridTableStyle tableStyle = CurrentTableStyle;
            CreateHeader(tableStyle);

            if (args.Action == CollectionChangeAction.Add)
            {
                if (tableStyle.GridColumnStyles.Count == 0)
                {
                    return;
                }

                for (int index = items.Count; index < lastCurrencyManager.Count; index++)
                {
                    CreateListItem(index, tableStyle);
                }
            }
            else if (args.Action == CollectionChangeAction.Remove)
            {
                // TODO: Is there a better way to do this?
                int toRemove = items.Count - lastCurrencyManager.Count;
                while (toRemove > 0)
                {
                    ListItemProvider item = items [items.Count - 1];
                    RemoveChildProvider(item);
                    item.Terminate();
                    items.Remove(item);
                    toRemove--;
                }
            }
        }
Пример #3
0
			internal void RemoveItemFrom (ListItemProvider child)
			{
				RemoveChildProvider (child);
				child.Terminate ();
			}