private void cbbValueMode_SelectedIndexChanged(object sender, EventArgs e) { if (cbbValueMode.SelectedIndex == ValueMode.ParcelPrice) { ValueBuffer.BuildParcels(); } else if (cbbValueMode.SelectedIndex == ValueMode.GridPrice) { ValueBuffer.BuildGrid(); } else if (cbbValueMode.SelectedIndex == ValueMode.Voronoi) { ValueBuffer.BuildCoverRangeGrid(); } Viewer.Current.Canvas.Invalidate(); }
private void NewDocument(bool withoutFactors = false, bool showMessage = true) { DisplayManager dm; if (showMessage) { Form waiting = new Form { Text = "CityGUI", StartPosition = FormStartPosition.CenterScreen, FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow, ShowInTaskbar = false, Size = new Size(200, 80) }; waiting.Controls.Add(new Label { Text = "Wait a minute...", Location = new Point(40, 20), Size = new Size(120, 40), Font = new Font("Tahoma", 7.5f) }); waiting.Show(); Func <DisplayManager> mayBeSlow = () => { return(new DisplayManager(DocumentManager.ActiveDocument.Content, withoutFactors)); }; var result = mayBeSlow.BeginInvoke(null, null); dm = mayBeSlow.EndInvoke(result); waiting.Close(); } else { dm = new DisplayManager(DocumentManager.ActiveDocument.Content, withoutFactors); } _display = dm; _display.Width = Canvas.Width; _display.Height = Canvas.Height; ResetVariables(); canvasWindow.ZoomExtent(); canvasWindow.Text = string.Format("City canvas: {0}", DocumentManager.ActiveDocument.ShortName); ValueBuffer.BuildParcels(); // newly 20110805 Canvas.Invalidate(); timer1.Start(); }