public void SetLocations(IEnumerable <Location> locations)
 {
     this.locations = locations;
     paises         = locations.Select(x => x.Pais).Distinct().ToList();
     paises.Sort();
     paises.Insert(0, other);
     PaisListTextField.SetListableObjects(paises);
     if (selected == null)
     {
         PaisListTextField.ForceInvokeEvent();
     }
     else
     {
         int indexPais = paises.IndexOf(selected.Pais);
         PaisListTextField.SetSelectionIndex(indexPais);
         ciudades = locations.Where(x => x.Pais.Equals(selected.Pais)).Select(x => x.Ciudad).Distinct().ToList();
         ciudades.Sort();
         ciudades.Insert(0, other);
         CiudadListTextField.SetListableObjects(ciudades);
         var index = ciudades.IndexOf(selected.Ciudad);
         CiudadListTextField.SetSelectionIndex(index);
         var filtered = locations.Where(x => x.Pais.Equals(selected.Pais) && x.Ciudad.Equals(selected.Ciudad)).OrderBy(x => x.Name).ToList();
         filtered.Insert(0, new Location()
         {
             Name = other, Pais = paises[indexPais], Ciudad = ciudades[index], IdLocation = -1
         });
         var s = filtered.Where(x => x.IdLocation == selected.IdLocation).First();
         index = filtered.IndexOf(s);
         CenterListTextField.SetListableObjects(filtered);
         CenterListTextField.SetSelectionIndex(index);
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (CenterListTextField != null)
            {
                CenterListTextField.Dispose();
                CenterListTextField = null;
            }

            if (CiudadListTextField != null)
            {
                CiudadListTextField.Dispose();
                CiudadListTextField = null;
            }

            if (Label1 != null)
            {
                Label1.Dispose();
                Label1 = null;
            }

            if (Label2 != null)
            {
                Label2.Dispose();
                Label2 = null;
            }

            if (Label3 != null)
            {
                Label3.Dispose();
                Label3 = null;
            }

            if (mandatoryLabel != null)
            {
                mandatoryLabel.Dispose();
                mandatoryLabel = null;
            }

            if (ModifyButton != null)
            {
                ModifyButton.Dispose();
                ModifyButton = null;
            }

            if (PaisListTextField != null)
            {
                PaisListTextField.Dispose();
                PaisListTextField = null;
            }

            if (TitleViewLabel != null)
            {
                TitleViewLabel.Dispose();
                TitleViewLabel = null;
            }
        }