private void insertItemBtn_Click(object sender, EventArgs e) { EventHandler <InsertItemEventArgs> handler = InsertItemEvent; Computers.Computer pars = new Computers.Computer { Id = (int)numericUpDown1.Value, Model = textBox1.Text, ProcessorType = textBox1.Text, ProcessorSpeed = (uint)numericUpDown2.Value, RAMSize = (uint)numericUpDown3.Value, HardDriveCapacity = (uint)numericUpDown4.Value, VideoCardMemory = (uint)numericUpDown5.Value, Price = (uint)numericUpDown6.Value, CopiesAvailable = (uint)numericUpDown7.Value }; handler?.Invoke(this, new InsertItemEventArgs(pars)); this.Close(); }
public InsertItemEventArgs(Computers.Computer paramValue) { Param = paramValue; }