//
// Updates the maximum number of sends if necessary that can be outstanding.
// Currently this only applies to VI network servers.
//
void CPageNetwork::OnKillfocusEMaxSends()
{
	Manager *manager;
	Worker *worker;

	// If max sends was left blank, use the previous value
	if (!m_EMaxSends.LineLength()) {
		ShowSettings();
	}
	// Verify that the max sends is > 0.
	else if (GetDlgItemInt(EMaxSends) <= 0) {
		ErrorMessage("Maximum # of Outstanding Sends cannot be 0.");
		ShowSettings();
		return;
	} else {
		// Seeing what kind of item is selected.
		switch (theApp.pView->m_pWorkerView->GetSelectedType()) {
		case WORKER:
			worker = theApp.pView->m_pWorkerView->GetSelectedWorker();
			worker->SetMaxSends(GetDlgItemInt(EMaxSends));
			break;
		case MANAGER:
			manager = theApp.pView->m_pWorkerView->GetSelectedManager();
			manager->SetMaxSends(GetDlgItemInt(EMaxSends));
			break;
		case ALL_MANAGERS:
			theApp.manager_list.SetMaxSends(GetDlgItemInt(EMaxSends));
			break;
		}
	}

	EnableWindow();
}