public void RemoveNode(TreeNode n) { if (n == null) { return; } if (n.Tag as Schedule != null) { if (MessageBox.Show(this, string.Format(Strings.BackupTreeView.ConfirmRemoveBackup, (n.Tag as Schedule).Name), Application.ProductName, MessageBoxButtons.YesNoCancel) == DialogResult.Yes) { lock (Program.MainLock) m_connection.DeleteObject(n.Tag); n.Remove(); } } else { if (MessageBox.Show(this, string.Format(Strings.BackupTreeView.ConfirmDeleteFolder, n.Text), Application.ProductName, MessageBoxButtons.YesNoCancel) == DialogResult.Yes) { foreach (TreeNode nx in FlattenTree(n.Nodes, false)) { lock (Program.MainLock) m_connection.DeleteObject(nx.Tag); } n.Remove(); } } }
public bool Remove(TKey key) { if (InternalSettings.ContainsKey(key)) { m_col.Remove(InternalSettings[key]); m_parent.DeleteObject(InternalSettings[key]); } return(InternalSettings.Remove(key)); }