private void OnDeleteTemplateClick(object o, EventArgs e) { try { if (MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button2) == DialogResult.OK) { TemplateNode tn = this.SelectedNode as TemplateNode; if (tn != null && tn.Template != null) { ConfigCtrl.DeleteTemplate(tn.Template); InitialNodes(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, CGConstants.MSG_SYSTEMERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); } }