using System.ComponentModel; using Unity; namespace ProjectLibrary { public partial class FormLibrary : Form { private readonly IUnityContainer _container; public FormLibrary(IUnityContainer container) { InitializeComponent(); _container = container ?? throw new ArgumentNullException(nameof(container)); } private void êàðòàÑîòðóäíèêàToolStripMenuItem_Click(object sender, EventArgs e) { } private void ÷èòàòåëèToolStripMenuItem_Click(object sender, EventArgs e) { try { _container.Resolve().ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void çàêàçàòüÊíèãèToolStripMenuItem_Click(object sender, EventArgs e) { try { _container.Resolve().ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Îøèáêà", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }