using ProjectGSM.Forms; using System.ComponentModel; using Unity; namespace ProjectGSM { public partial class FormAdvocateApp : Form { private readonly IUnityContainer _container; public FormAdvocateApp(IUnityContainer container) { InitializeComponent(); _container = container ?? throw new ArgumentNullException(nameof(container)); } private void clientsMenuItem_Click_1(object sender, EventArgs e) { try { _container.Resolve().ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void advocatesMenuItem_Click(object sender, EventArgs e) { try { _container.Resolve().ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void casesMenuItem_Click(object sender, EventArgs e) { try { _container.Resolve().ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void courtsToolStripMenuItem_Click(object sender, EventArgs e) { try { _container.Resolve().ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void statusHistoryRepositoryMenuItem_Click(object sender, EventArgs e) { try { _container.Resolve().ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }