public override bool Equals(object obj) { if (!(obj is PunchcardFormat)) { return(false); } PunchcardFormat other = (PunchcardFormat)obj; if (other.leftToRight != leftToRight) { return(false); } if (other.topToBottom != topToBottom) { return(false); } if (other.boxesAcross != boxesAcross) { return(false); } if (other.boxesDown != boxesDown) { return(false); } return(true); }
public object Clone() { PunchcardFormat other = new PunchcardFormat(); other.boxesAcross = boxesAcross; other.boxesDown = boxesDown; other.leftToRight = leftToRight; other.topToBottom = topToBottom; return other; }
public object Clone() { PunchcardFormat other = new PunchcardFormat(); other.boxesAcross = boxesAcross; other.boxesDown = boxesDown; other.leftToRight = leftToRight; other.topToBottom = topToBottom; return(other); }
// Get a punch pattern renderer for rendering the description from a course view. private PunchesRenderer GetRenderer(CourseView courseView) { PunchcardFormat punchcardFormat = eventDB.GetEvent().punchcardFormat; PunchesRenderer renderer = new PunchesRenderer(eventDB); renderer.CellSize = punchPrintSettings.BoxSize / 0.254F; renderer.CourseView = courseView; renderer.PunchcardFormat = punchcardFormat; renderer.Margin = 0; return(renderer); }
private void punchCardLayoutButton_Click(object sender, EventArgs e) { PunchcardLayoutDialog dialog = new PunchcardLayoutDialog(); PunchcardFormat format = controller.GetPunchcardFormat(); dialog.PunchcardFormat = format; DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK && !format.Equals(dialog.PunchcardFormat)) { controller.SetPunchcardFormat(dialog.PunchcardFormat); } dialog.Dispose(); }
private void formatButton_Click(object sender, EventArgs e) { // Init dialog. PunchcardLayoutDialog dialog = new PunchcardLayoutDialog(); dialog.PunchcardFormat = punchcardFormat; // show. DialogResult result = dialog.ShowDialog(); // Get result if OK pressed. if (result == DialogResult.OK) { punchcardFormat = dialog.PunchcardFormat; } dialog.Dispose(); }
// Set the punch card format for the event. public static void ChangePunchcardFormat(EventDB eventDB, PunchcardFormat punchcardFormat) { Event e = eventDB.GetEvent(); e = (Event) e.Clone(); e.punchcardFormat = (PunchcardFormat) punchcardFormat.Clone(); eventDB.ChangeEvent(e); }