//----------------------------------------------------------------------- public static bool EditeSmartFieldAndCommit(CSmartField field) { CFormEditeSmartField form = new CFormEditeSmartField(); form.m_smartField = field; bool bResult = form.ShowDialog() == DialogResult.OK; form.Dispose(); return(bResult); }
//----------------------------------------------------------------------- private static void itemCreateSmartField_Click(object sender, EventArgs e) { ToolStripMenuItem item = sender as ToolStripMenuItem; CTagMenu tag = item != null ? item.Tag as CTagMenu : null; if (tag != null) { CSmartField smartField = new CSmartField(CSc2iWin32DataClient.ContexteCourant); smartField.CreateNew(); smartField.TypeCible = tag.TypeSource; smartField.Definition = tag.DefProp; CFormEditeSmartField.EditeSmartFieldAndCommit(smartField); } }
//----------------------------------------------------------------------- private static void itemEditSmartField_Click(object sender, EventArgs e) { ToolStripMenuItem item = sender as ToolStripMenuItem; CTagMenu tag = item != null ? item.Tag as CTagMenu : null; if (tag != null && tag.SmartField != null) { CSmartField smartField = tag.SmartField.GetObjetInContexte(CSc2iWin32DataClient.ContexteCourant) as CSmartField; smartField.BeginEdit(); if (smartField != null) { CFormEditeSmartField.EditeSmartFieldAndCommit(smartField); } } }