Пример #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();
        }
Пример #2
0
        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);
        }
Пример #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>();
        }
Пример #4
0
 public AvlList()
 {
     _tree  = new OrderedAvlTree <T>();
     _nodes = new EditableLookup <T, AvlTreeNode <T> >();
 }
Пример #5
0
 public void Clear()
 {
     _nodes = new EditableLookup <T, AvlTreeNode <T> >();
     _tree  = new OrderedAvlTree <T>();
 }
Пример #6
0
 public void Reset(IEnumerable <T> items)
 {
     _tree  = new OrderedAvlTree <T>(items);
     _nodes = _tree.ToEditableLookup(node => node.Item);
 }