コード例 #1
0
        private void btnTaxi_Click(object sender, RoutedEventArgs e)
        {
            var vehicle = new Taxi
            {
                Fares = _random.Next(1, 8)
            };

            var inbound = _random.NextBool();

            TollSystem.AddEntry(vehicle, GenerateTimeStamp(), inbound, GenerateLicense());
        }
コード例 #2
0
        private void btnDeliveryTruck_Click(object sender, RoutedEventArgs e)
        {
            var vehicle = new DeliveryTruck
            {
                GrossWeightClass = _random.Next(1000, 10000)
            };

            var inbound = _random.NextBool();

            TollSystem.AddEntry(vehicle, GenerateTimeStamp(), inbound, GenerateLicense());
        }
コード例 #3
0
        private void btnBus_Click(object sender, RoutedEventArgs e)
        {
            var capacity = _random.Next(1, 6);
            var riders   = _random.Next(1, capacity);

            var vehicle = new Bus
            {
                Capacity = capacity,
                Riders   = riders
            };

            var inbound = _random.NextBool();

            TollSystem.AddEntry(vehicle, GenerateTimeStamp(), inbound, GenerateLicense());
        }
コード例 #4
0
 private void btnNull_Click(object sender, RoutedEventArgs e)
 {
     TollSystem.AddEntry(null, DateTime.Now, false, null);
 }