/// <summary> /// Constructor that takes a RecordController object from the LoginForm /// </summary> /// <param name="newController"></param> public ListRecordForm(RecordController newController) { controller = newController; invoker = controller.getInvoker(); reqHandler = new DiscogsRequestHandler(); InitializeComponent(); if (invoker.checkUndoStack() == false) { undoBtn.Enabled = false; } else { undoBtn.Enabled = true; } if (invoker.checkRedoStack() == false) { redoBtn.Enabled = false; } else { redoBtn.Enabled = true; } controller.readRecordListToFile(); this.FormBorderStyle = FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.IsMdiContainer = true; recordListView.View = View.Details; this.populateList(controller.getRecordList().getList()); SetCollectionInfo(); }
/// <summary> /// RecordController constructor, generates a unique ID for the list. (Good for accounts later). /// </summary> public RecordController() { if (recInvoker == null) { recInvoker = new RecordInvoker(); } recordList = new RecordList(); generateUniqueID(); }
public void initTests() { rec = new Record(new RecordInfoBuilder() .withRecordName("test") .withArtist("testArtist") .withYear(2000) .withRecordCondition(RecordCondition.Good) .withSleeveCondition(RecordCondition.Good) .withPrice(100.0) .withID(100) .build()); list = new RecordList(); r = new RecordInvoker(); }
/// <summary> /// Sets the invoker for the record controller. /// </summary> /// <param name="invoker"></param> public void addInvoker(RecordInvoker invoker) { this.recInvoker = invoker; }