private void disableTSQLToolStripMenuItem_Click(object sender, EventArgs e) { var con = GetService(treeView.SelectedNode); var node = treeView.SelectedNode; WorkAsync(new WorkAsyncInfo { Message = "Disabling...", Work = (worker, args) => { TSqlEndpoint.Disable(con.ServiceClient); }, PostWorkCallBack = (args) => { if (args.Error != null) { MessageBox.Show("Error disabling TDS Endpoint:\r\n\r\n" + args.Error.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } node.Text = "TDS Endpoint (Disabled)"; node.ImageIndex = 20; node.SelectedImageIndex = 20; } }); }
private void disableTSQLToolStripMenuItem_Click(object sender, EventArgs e) { var con = GetService(treeView.SelectedNode); try { TSqlEndpoint.Disable(con.ServiceClient); treeView.SelectedNode.ImageIndex = 20; treeView.SelectedNode.SelectedImageIndex = 20; treeView.SelectedNode.Text = "T-SQL Endpoint (Disabled)"; } catch (Exception ex) { MessageBox.Show("Error enabling T-SQL Endpoint:\r\n\r\n" + ex.Message); } }