private void Event_Create(object sender, EventArgs e) { if (txtRemoveWormholeName.Text.Trim() == string.Empty) { MessageBoxLoader.Show(@"You need set name for route.", this); txtRemoveWormholeName.Focus(); return; } if (gridWaypoints.Rows.Count < 1) { MessageBoxLoader.Show(@"Add waypoints to route.", this); return; } var data = new List <string>(); foreach (DataGridViewRow row in gridWaypoints.Rows) { if (row.Cells["clmSolarSystemName"].Value != null) { data.Add(row.Cells["clmSolarSystemName"].Value.ToString()); } } _waypoints.Create(txtRemoveWormholeName.Text.Trim(), data); ShowContainerAllRoutes(); }
private void Event_SetDestinationForCurrentRoute(object sender, EventArgs e) { whlButton1.IsActive = false; int count = _waypoints.SetDestinationByRoute(txtRouteName.Text, Global.Pilots.Selected); whlButton1.IsActive = true; MessageBoxLoader.Show(String.Format("Route added to pilot {0} with {1} waypoints.", Global.Pilots.Selected.Name, count), this); }
private void Event_ShowRoute(object sender, EventArgs e) { if (gridAllRoutes.CurrentCell == null) { MessageBoxLoader.Show(@"Please select route.", this); return; } if (string.IsNullOrEmpty(gridAllRoutes.CurrentCell.Value.ToString()) == false) { txtRouteName.Text = gridAllRoutes.CurrentCell.Value.ToString(); ShowContainerRoute(gridAllRoutes.CurrentCell.Value.ToString()); } }
private void Event_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) { var solarSystemName = (string)e.FormattedValue; if (solarSystemName == "") { return; } if (Global.Space.GetSystemByName(solarSystemName.ToUpper()) == null) { e.Cancel = true; MessageBoxLoader.Show(string.Format("Solar system with name \"" + solarSystemName + "\" is not exist."), this); } }
private void EventSetDestination(object sender, EventArgs e) { if (gridAllRoutes.CurrentCell == null) { MessageBoxLoader.Show("Please select route.", this); return; } if (string.IsNullOrEmpty(gridAllRoutes.CurrentCell.Value.ToString()) == false) { whlButton1.IsActive = false; int count = _waypoints.SetDestinationByRoute(gridAllRoutes.CurrentCell.Value.ToString(), Global.Pilots.Selected); whlButton1.IsActive = true; MessageBox.Show(String.Format("Route added to pilot {0} with {1} waypoints.", Global.Pilots.Selected.Name, count)); ShowContainerAllRoutes(); } }