Exemplo n.º 1
0
        public MainWindow()
        {
            try
            {
                this.InitializeComponent();

                var connection = new Connection
                                     {
                                         ApplicationId = 2745992, 
                                         Scope = (int)ScopeList.AccessToAudio
                                     };

                var dialog = new SigningWindow(connection);

                if (dialog.ShowDialog() == true)
                {
                    DataContext = new SearcherViewModel(new AudioAdapter(dialog.Connection));
                }
                else
                {
                    Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        public void Test1()
        {
            var vm = new SearcherViewModel();

            vm.Query = "ezis94";
            Assert.IsFalse(vm.IsBusy, "The App is busy");
            vm.SubmitCommand.Execute(null);
            Assert.IsFalse(vm.IsBusy, "The App has not finished its task");

            // Assert.Pass();
        }
Exemplo n.º 3
0
        public void Test2()
        {
            var vm = new SearcherViewModel();

            vm.Query = "ez";
            Assert.IsNotNull(vm.SubmitCommand, "command not initialized");
            Assert.IsTrue(vm.Query == "ez", "wrong query");
            vm.SubmitCommand.Execute(null);
            //GitHub does not like when Bots are making requests to it
            Assert.IsNull(vm.UserModel, "The response was successfull");
        }
Exemplo n.º 4
0
        public SearchPage()
        {
            var vm = new SearcherViewModel();

            this.BindingContext = vm;
            InitializeComponent();
            Query.Completed += (object sender, EventArgs e) =>
            {
                Search.Command.Execute(null);
            };
        }
        public IEnumerable <SearcherViewModel> GetAllDestinationOffered(int id, DateTime date)
        {
            List <SearcherViewModel>         listSearcher = new List <SearcherViewModel>();
            IEnumerable <DestinationOffered> destinations = _destinationOffered.GetDestinationOfferedsByStationID(id);

            if (destinations != null && destinations.Any())
            {
                foreach (DestinationOffered destination in destinations)
                {
                    List <AvailabilityViewModel>   availabilities = new List <AvailabilityViewModel>();
                    IEnumerable <VehicleDeparture> vehicles       = _vehicleDeparture.GetVehicleDeparturesByDestinationId(destination.Id, date);
                    if (vehicles != null && vehicles.Any())
                    {
                        foreach (VehicleDeparture vehicle in vehicles)
                        {
                            AvailabilityViewModel availability = new AvailabilityViewModel()
                            {
                                Id            = vehicle.Id,
                                DepartureDate = vehicle.DateTime,
                                Status        = vehicle.State,
                                VehiclePlaque = vehicle.Plaque
                            };
                            availabilities.Add(availability);
                        }
                    }
                    SearcherViewModel searcherView = new SearcherViewModel()
                    {
                        StationId    = destination.DestinationId,
                        CompanyName  = destination.CompanyNit,
                        Price        = destination.DestinationPrice,
                        Availability = availabilities.AsEnumerable()
                    };
                    listSearcher.Add(searcherView);
                }
            }
            return(listSearcher.AsEnumerable());
        }
        // GET: PreguntaRespuesta
        public ActionResult Index()
        {
            SearcherViewModel model = new SearcherViewModel();

            return(View(model));
        }
Exemplo n.º 7
0
 internal void InitializeDataContext()
 {
     DataContext = new SearcherViewModel();
 }
Exemplo n.º 8
0
        public Settings(SearcherViewModel dataContext)
        {
            InitializeComponent();

            DataContext = dataContext;
        }