private void copy_Click(object sender, EventArgs e) { if (Index >= 0) { copiedExit = Trigger.Copy(); } }
// private void AddNew(ExitTrigger exit) { if (Model.FreeExitSpace() >= 8) { this.listBox.Focus(); if (triggers.Count < 28) { if (listBox.Items.Count > 0) { triggers.Insert(Index + 1, exit); } else { triggers.Insert(0, exit); } int reselect; if (listBox.Items.Count > 0) { reselect = Index; } else { reselect = -1; } BuildListBox(reselect); } else { MessageBox.Show("Could not insert any more exit triggers. The maximum number of exit triggers allowed per area is 28.", "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Could not insert the trigger. " + Model.MaximumSpaceExceeded("exits"), "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Creates a deep copy of this instance. /// </summary> /// <returns></returns> public ExitTrigger Copy() { ExitTrigger copy = new ExitTrigger(); copy.Destination = Destination; copy.ExitType = ExitType; copy.ShowBanner = ShowBanner; copy.X = X; copy.Y = Y; copy.Z = Z; copy.Height = Height; copy.EnableEdgeX = EnableEdgeX; copy.EnableEdgeY = EnableEdgeY; copy.DstX = DstX; copy.DstY = DstY; copy.DstZ = DstZ; copy.DstF = DstF; copy.DstXb7 = DstXb7; copy.DstYb7 = DstYb7; copy.Width = Width; copy.F = F; return(copy); }