public void ClearContentElements() { for (int num = this.list.Count - 1; num >= 0; num--) { HotRegion hotRegion = this.list[num] as HotRegion; if (hotRegion != null && (hotRegion.SelectedObject is IContentElement || hotRegion.SelectedObject is GridAttributes)) { this.list.RemoveAt(num); this.selectedObjectIndex.Remove(hotRegion.SelectedObject); hotRegion.Dispose(); } } }