public override void Dispose() { _CompositeDisposable.Dispose(); Text?.Dispose(); SelectedItem?.Dispose(); NowUpdateCandidateList?.Dispose(); base.Dispose(); }
private void RemoveButton_OnClick(object sender, RoutedEventArgs e) { if (SelectedItem != null) { SelectedItem.Dispose(); FileMonitors.Remove(SelectedItem); } }
public void Dispose() { Model = null; foreach (var item in Options) { item.Dispose(); } SelectedItem.Dispose(); SelectedItem = null; }
/// <summary> /// Deletes the currently selected Item /// </summary> public void DelItem() { if (SelectedItem == null) { return; } SelectedItem.Remove(); SelectedItem.Dispose(); int oldindex = SelectedScene.Items.IndexOf(SelectedItem); SelectedScene.Items.Remove(SelectedItem); if (SelectedScene.Items.Any()) { SetItem(oldindex < SelectedScene.Items.Count ? SelectedScene.Items[oldindex] : SelectedScene.Items.Last()); } }