Nexus.Client.ModManagement.AutoUpdater.RegisteredMods_CollectionChanged C# (CSharp) Method

RegisteredMods_CollectionChanged() private method

Handles the INotifyCollectionChanged.CollectionChanged event of the list of managed mods.
This checks for the newest information for mods that are added to the mod manager.
private RegisteredMods_CollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void
sender object The object that raised the event.
e System.Collections.Specialized.NotifyCollectionChangedEventArgs A describing the event arguments.
return void
		private void RegisteredMods_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
		{
			if (!EnvironmentInfo.Settings.CheckForNewModVersions)
				return;
			switch (e.Action)
			{
				case NotifyCollectionChangedAction.Add:
				case NotifyCollectionChangedAction.Replace:
					foreach (IMod modMod in e.NewItems)
						((Func<IMod, IModInfo>)CheckForUpdate).BeginInvoke(modMod, GotNewVersionNumber, modMod);
					break;
				case NotifyCollectionChangedAction.Remove:
				case NotifyCollectionChangedAction.Reset:
					foreach (IMod modMod in e.OldItems)
						m_oclNewInfo.RemoveAll(x => x.Mod == modMod);
					break;
			}
		}