Ejemplo n.º 1
0
 private void Create_DataTable_Form(NavigationButtons.Navigation xnav)
 {
     if (m_DataTable_Form == null)
     {
         if (m_pTableDockingFormXml.m_DataTableFormXml == null)
         {
             m_pTableDockingFormXml.m_DataTableFormXml = new DataTableFormXml();
         }
         m_DataTable_Form = (DataTable_Form)CreateDockForm(new Guid(guid.gDocking_TableGrid_Form.ToByteArray()), m_DBTables, m_tbl, this, m_pTableDockingFormXml.m_DataTableFormXml.wrect, null,xnav);
         info_DataTable_Form = _docker.Add(m_DataTable_Form, zAllowedDock.All, new Guid(guid.gDocking_TableGrid_Form.ToByteArray()));
         _docker.DockForm(info_DataTable_Form, DockStyle.Right, zDockMode.Inner);
     }
     else
     {
         m_DataTable_Form.Activate();
     }
 }
Ejemplo n.º 2
0
 private void _docker_FormClosed(object sender, FormEventArgs e)
 {
     if (e.Form.GetType() == typeof(DataTable_Form))
     {
         m_DataTable_Form.Dispose();
         m_DataTable_Form = null;
     }
     else if (e.Form.GetType() == typeof(EditTable_Form))
     {
         m_EditTable_Form.Dispose();
         m_EditTable_Form = null;
         m_tbl.inpCtrlList.Clear();
     }
     else if (e.Form.GetType() == typeof(CreateView_Form))
     {
         m_CreateView_Form.Dispose();
         m_CreateView_Form = null;
         m_tbl.DefineView_inpCtrlList.Clear();
     }
     else if (e.Form.GetType() == typeof(TableView_Form))
     {
         int i;
         for (i = 0; i < guid.MaxTableViews; i++)
         {
             if (e.Form == m_TableView_Form[i])
             {
                 m_TableView_Form[i].Dispose();
                 m_TableView_Form[i] = null;
             }
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Create test form
        /// </summary>
        /// <param name="identifier">form identifier</param>
        /// <returns>test form</returns>
        /// 
        private static Form CreateDockForm(Guid identifier, DBTableControl dbTables, SQLTable x_tbl, TableDockingForm pParentForm, wRect wrect, ViewXml xViewXml,NavigationButtons.Navigation xnav)
        {
            if (identifier == new Guid(guid.gDocking_TableGrid_Form.ToByteArray()))
            {
                DataTable_Form result = new DataTable_Form(dbTables, x_tbl, DataTable_Form.DataTable_Form_ENUM.EDIT_OR_DELETE, pParentForm);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else if (identifier == new Guid(guid.gDocking_EditTable_Form.ToByteArray()))
            {
                EditTable_Form result = new EditTable_Form(dbTables, x_tbl, pParentForm,SetControls,false,xnav);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else if (identifier == new Guid(guid.gDocking_CreateView_Form.ToByteArray()))
            {
                CreateView_Form result = new CreateView_Form(dbTables, x_tbl, pParentForm, xnav);
                result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                return result;
            }
            else
            {
                for (int i = 0; i < guid.MaxTableViews; i++)
                {
                    if (identifier == new Guid(guid.gDocking_TableView_Form[i].ToByteArray()))
                    {
                        TableView_Form result = new TableView_Form(i, dbTables, x_tbl, pParentForm, xViewXml);
                        result.Bounds = new Rectangle(wrect.Left, wrect.Top, wrect.Width, wrect.Height);
                        return result;
                    }
                }
            }

            throw new InvalidOperationException();
        }