Exemplo n.º 1
0
        private void OpenFormInternal <T>(IEntityForm <T> form, ListViewKey key, T entity)
            where T : IIdEntity
        {
            form.LoadEntity(entity);
            form.EntitySave += new EntitySaveEventHandler(form_EntitySave);

            if (CurrentFormTab.Controls.Count == 0 || CurrentFormTab.Controls[0] != form)
            {
                form.Dock = DockStyle.Fill;
                form.Name = key.ToString() + "Form";

                CurrentFormTab.Controls.Clear();
                CurrentFormTab.Controls.Add(form.ToControl());
            }
        }