public MainForm(SerializationInfo si, StreamingContext sc) { //todo: odstranit button1 model = (GameRecords)si.GetValue("model", typeof(GameRecords)); view = (View2)si.GetValue("view", typeof(View2)); view.form = this; playingHeight = si.GetByte("height"); playingWidth = si.GetByte("width"); InitializeComponent(); InitializeTasks(); timerTicks = 0; IsMdiContainer = true; accessoriesToolStripMenuItem.Checked = false; amusform = new AmusementsForm(model, mainDockPanel, amusementsToolStripMenuItem); pathform = new PathForm(model, pathToolStripMenuItem); accform = new AccessoriesForm(model, accessoriesToolStripMenuItem); mapform = new MapForm(model, view, playingWidth, playingHeight); PrepareFormsStartAppearance(model.currOfferedAmus, model.currOfferedPaths, model.currOfferedOthers, model.images); amusform.Show(mainDockPanel); pathform.Show(mainDockPanel); view.form = this; mapform.InitializeAfterDeserialization(model, view); timer.Enabled = true; MyUpdate(); this.Refresh(); }
public MainForm(byte playingWidth, byte playingHeight, StartForm startForm) { InitializeComponent(); InitializeTasks(); IsMdiContainer = true; this.playingHeight = playingHeight; this.playingWidth = playingWidth; this.startForm = startForm; model = new GameRecords(playingHeight, playingWidth, startForm.initialAmusementsFilename, startForm.initialPathsFilename, startForm.initialAccessoriesFilename, startForm.revealingRulesFilename); amusform = new AmusementsForm(model, mainDockPanel, amusementsToolStripMenuItem); pathform = new PathForm(model, pathToolStripMenuItem); accform = new AccessoriesForm(model, accessoriesToolStripMenuItem); view = new View2(model, this); mapform = new MapForm(model, view, playingWidth, playingHeight); amusform.Show(mainDockPanel); pathform.Show(mainDockPanel); accessoriesToolStripMenuItem.Checked = false; mapform.Show(mainDockPanel); timer.Enabled = true; }
public void ChangeAfterDeserialization(View2 view) { view.form = this; this.model = view.model; this.view = view; this.playingHeight = model.playingHeight; this.playingWidth = model.playingWidth; // InitializeComponent(); InitializeTasks(); timerTicks = 0; IsMdiContainer = true; accessoriesToolStripMenuItem.Checked = false; amusform.Dispose(); pathform.Dispose(); accform.Dispose(); amusform = new AmusementsForm(model, mainDockPanel, amusementsToolStripMenuItem); pathform = new PathForm(model, pathToolStripMenuItem); accform = new AccessoriesForm(model, accessoriesToolStripMenuItem); PrepareFormsStartAppearance(model.currOfferedAmus, model.currOfferedPaths, model.currOfferedOthers, model.images); amusform.Show(mainDockPanel); pathform.Show(mainDockPanel); mapform.InitializeAfterDeserialization(model, view); timer.Enabled = true; MyUpdate(); this.Refresh(); }