private void OnSetColorOptions_Click(object sender, EventArgs e) { using (var colorOptions = new ColorOptionsDialog()) { var serverData = Persistence.LoadServerData(); colorOptions.GridLineColor = this.ctlDnDMap.GridPen.Color; if (colorOptions.ShowDialog(this) == DialogResult.OK) { var newColor = colorOptions.GridLineColor; this.ctlDnDMap.GridPen = new Pen(newColor); serverData.GridColorA = newColor.A; serverData.GridColorR = newColor.R; serverData.GridColorG = newColor.G; serverData.GridColorB = newColor.B; serverData.IsGridColorSet = true; Persistence.SaveServerData(serverData); connection.WriteGridColor(colorOptions.GridLineColor.ToSocketColor()); this.ctlDnDMap.SetGridColor(colorOptions.GridLineColor.ToSocketColor()); this.ctlDnDMap.RefreshAll(); } } }
private void OnSetColorOptions_Click(object sender, EventArgs e) { using (var colorOptions = new ColorOptionsDialog()) { var serverData = Persistence.LoadServerData(); colorOptions.GridLineColor = this.ctlDnDMap.GridPen.Color; if (colorOptions.ShowDialog(this) == DialogResult.OK) { var newColor = colorOptions.GridLineColor; this.ctlDnDMap.GridPen = new Pen(newColor); serverData.GridColorA = newColor.A; serverData.GridColorR = newColor.R; serverData.GridColorG = newColor.G; serverData.GridColorB = newColor.B; serverData.IsGridColorSet = true; Persistence.SaveServerData(serverData); connection.WriteGridColor(colorOptions.GridLineColor.ToSocketColor()); this.ctlDnDMap.SetGridColor(colorOptions.GridLineColor.ToSocketColor()); this.ctlDnDMap.RefreshAll(); } } }