Ejemplo n.º 1
0
        internal void Find()
        {
            StringDialog dialog = new StringDialog("A partial description");

            dialog.ShowDialog();
            if (dialog.Accept)
            {
                string description = dialog.YourString;
                AbstractLocationRepository lRepo = _locationRepository;
                Location loc = null;
                try
                {
                    loc = lRepo.GetByDescription(description);
                }
                catch (Exception ex)
                {
                    ReportIt("The description must specify a unique location");
                }
                if (loc != null)
                {
                    LocationView view = new LocationView(this);
                    view.ShowDialog();
                }
            }
        }
Ejemplo n.º 2
0
        internal void SetLocation()
        {
            List <string> descriptions = new List <string>();

            foreach (Location l in _locationRepository.List())
            {
                descriptions.Add(l.Description);
            }
            StringChooser chooser = new StringChooser(descriptions);

            chooser.ShowDialog();
            if (chooser.Accept)
            {
                string   description = chooser.ChosenString;
                Location loc         = _locationRepository.GetByDescription(description);
                CurrentFilm.Location = loc;
            }
        }