Esempio n. 1
0
        public SelectionHelperBehavior(FasterMultiSelectListBox listBox)
        {
            _listBox = listBox;

            _itemToNotifier = new Dictionary <object, BindingNotifyier>();
            _keyToItems     = new EditableLookup <object, object>();
            _itemToKey      = new Dictionary <object, object>();

            ListBoxSelectedItems_Initialized();
        }
        public static EditableLookup <K, T> ToEditableLookup <K, T>(this IEnumerable <IGrouping <K, T> > source)
        {
            var res = new EditableLookup <K, T>();

            foreach (var grouping in source)
            {
                res.Reset(grouping.Key, grouping);
            }

            return(res);
        }
Esempio n. 3
0
        public AccessInterceptor(InterfaceState state, bool allowModifications = false)
        {
            _state = state;
            _allowModifications = allowModifications;

            _oldValues           = state.Properties.ToDictionary(p => p, p => state[p]);
            _oldCollectionValues = state.CollectionProperties
                                   .ToDictionary(p => p, p => (state[p] as IEnumerable).Cast <object>().ToArray());
            _collectionChanges = new EditableLookup <PropertyInfo, IChange>();
            _literalChanges    = new Dictionary <PropertyInfo, object>();
            _proxies           = new Dictionary <PropertyInfo, IStateList>();
        }
Esempio n. 4
0
 public AvlList()
 {
     _tree  = new OrderedAvlTree <T>();
     _nodes = new EditableLookup <T, AvlTreeNode <T> >();
 }
Esempio n. 5
0
 public void Clear()
 {
     _nodes = new EditableLookup <T, AvlTreeNode <T> >();
     _tree  = new OrderedAvlTree <T>();
 }
Esempio n. 6
0
 public void Reset(IEnumerable <T> items)
 {
     _tree  = new OrderedAvlTree <T>(items);
     _nodes = _tree.ToEditableLookup(node => node.Item);
 }