public static void PopupCChannelConfigForm(object obj) { if (CCurrentLoginUser.Instance.IsAdmin) { var window = new CProtocolConfigForm(true); var node = obj as CTreeNode; if (node != null) { window.SetDefaultText(node.Text); } window.ProtocolConfigChanged += MainForm.ProtocolConfigChanged; PopUpWindow(window); } }
static void ChannelTabPage_DataGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (CCurrentLoginUser.Instance.IsAdmin) { var name = m_ChannelTabPage.DataGrid.Rows[e.RowIndex].Cells[0].Value.ToString(); var window = new CProtocolConfigForm(true) { StartPosition = FormStartPosition.CenterScreen }; window.SetDefaultText(name); window.ProtocolConfigChanged += MainForm.ProtocolConfigChanged; window.Show(); } }