public void RedoButton_Click(object sender, EventArgs e) { try { MandelbrotData data = RedoData.Pop(); IterationsTextbox.Text = Convert.ToString(data.GetIter()); ZoomScaleTextBox.Text = Convert.ToString(data.GetZoomScale()); Greyscale.Checked = data.GetGrey(); BlackAndWhite.Checked = data.GetBlackWhite(); this.MaximumXValue = data.GetXMax(); this.MinimumXValue = data.GetXMin(); this.MaximumYValue = data.GetYMax(); this.MinimumYValue = data.GetYMin(); XMinLabel.Text = Convert.ToString(this.MinimumXValue); XMaxLabel.Text = Convert.ToString(this.MaximumXValue); YMinLabel.Text = Convert.ToString(this.MinimumYValue); YMaxLabel.Text = Convert.ToString(this.MaximumYValue); this.ZExponentBox.Value = (int)data.GetZExponent(); this.CExponentBox.Value = (int)data.GetCExponent(); UndoData.Push(data); } catch (StackUnderflowException stackException) { MBOX(stackException.Message); } catch (Exception e2) { MessageBox.Show("Exception Trapped: " + e2.Message, "Error"); } }
private void StateDropDown_SelectedIndexChanged(object sender, EventArgs e) { string filename = StateDropDown.Text + ".xml"; string XmlFilePath = @"C:\Users\" + this.ComputerUserName + "\\Documents\\Mandelbrot\\" + this.rName + "\\SavedStates\\" + filename; string XmlContents = File.ReadAllText(XmlFilePath); MandelbrotData FileData = XmlContents.FromXml <MandelbrotData>(); this.IterationsTextbox.Text = Convert.ToString(FileData.GetIter()); this.ZoomScaleTextBox.Text = Convert.ToString(FileData.GetZoomScale()); this.MaximumXValue = FileData.GetXMax(); this.MaximumYValue = FileData.GetYMax(); this.MinimumXValue = FileData.GetXMin(); this.MinimumYValue = FileData.GetYMin(); this.Greyscale.Checked = FileData.GetGrey(); this.BlackAndWhite.Checked = FileData.GetBlackWhite(); this.ZExponentBox.Value = Convert.ToDecimal(FileData.GetZExponent()); this.CExponentBox.Value = Convert.ToDecimal(FileData.GetCExponent()); }