private void PopulateAccessPoinsPnls() { List <AccessPoint> allAccessPointsFromWorld = AccessPoint.GetAllAccessPointFromWorldExceptFromOneLocation(world, currentLocation); foreach (AccessPointPnl apPanel in accessPointsPnls) { foreach (AccessPoint ap in accessPoints) { if (ap.Direction == apPanel.direction) { apPanel.cbZone.SelectedItem = ap.DestZone.ToString(); apPanel.cbDest.SelectedItem = ap.DestLoc.ToString(); } } //foreach (AccessPoint ap in allAccessPointsFromWorld) //{ // if (AccessPoint.ReturnOppositeDirection(apPanel.lblDir.Text) == ap.Direction && // ap.DestZone == currentZone.Name && // ap.DestLoc ==currentLocation.Title) // { // apPanel.cbZone.SelectedItem = ap.DestZone.ToString(); // apPanel.cbDest.SelectedItem = ap.DestLoc.ToString(); // } //} } }
private AccessPoint GetConflictingAccessPoint(ComboBox cb) { if (!String.IsNullOrWhiteSpace(cb.Text)) { AccessPointPnl currentApPnl = GetAccessPointPanelFromCb(cb); AccessPoint tempAp = GetAccessPointFromAnAccessPointPanel(currentApPnl); List <AccessPoint> allAccessPoints = AccessPoint.GetAllAccessPointFromWorldExceptFromOneLocation(world, currentLocation); foreach (AccessPoint ap in allAccessPoints) { if (ap.IsEqualTo(tempAp)) { return(ap); } } return(null); } return(null); }