private ListItem[] GetShippingProviderServiceCodes() { List <ListItem> codes = new List <ListItem>(); ShippingProvider provider = AvailableProviders.FindProviderById(ShippingProviderField.SelectedValue); if (String.Compare(provider.ProviderId, ShippingProviderField.SelectedValue, true) == 0) { foreach (ListItem item in provider.ListServiceCodes()) { codes.Add(item); } } return(codes.ToArray()); }