Esempio n. 1
0
        private static void UnlockedDictionary_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
            case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
            {
                foreach (var item in e.NewItems)
                {
                    UnlockedData ud = item as UnlockedData;

                    ud.PropertyChanged += Unlocked_PropertyChanged;

                    SetRegionLock(ud.Region, ud.Unlocked);
                }
            }
            break;

            default:
            case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
            case System.Collections.Specialized.NotifyCollectionChangedAction.Replace:
            case System.Collections.Specialized.NotifyCollectionChangedAction.Move:
            case System.Collections.Specialized.NotifyCollectionChangedAction.Reset:
                break;
            }
            ;
        }
Esempio n. 2
0
        private static void Unlocked_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            UnlockedData ud = sender as UnlockedData;

            foreach (var item in Configuration.UnlockedList)
            {
                if (item.Region == ud.Region)
                {
                    SetRegionLock(ud.Region, ud.Unlocked);
                }
            }

            foreach (var item in Configuration.ResourceList)
            {
                if (item.Region == ud.Region)
                {
                    SetRegionLock(ud.Region, ud.Unlocked);
                }
            }

            MainWindow.RefreshFilter();
        }