/// <summary> /// Refresh the collection and close the form /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void btnClose_Click(object sender, EventArgs e) { if (wasModified) { items.Clear(); for (int idx = 0; idx < lbContentItems.Items.Count; idx++) { items.Add((ContentItem)lbContentItems.Items[idx]); } } this.Close(); }
/// <summary> /// Unload all of the resources. /// </summary> public void Unload() { if (IsLoading) { throw new InvalidOperationException("Content Manager is currently loading"); } lock (_contentItems) { foreach (ContentItem item in _contentItems) { item.Dispose(); } _contentItems.Clear(); } }