예제 #1
0
 public void RequestProcessVehicle(GarageAssignment assignment)
 {
     if (State is MediatorProcessingState)
     {
         (State as MediatorProcessingState).ProcessVehicle(assignment);
     }
 }
예제 #2
0
        private void _mediator_IDScanned(object sender, GarageAssignment assignment, VehicleInformation information)
        {
            if (assignment == null || information == null)
            {
                System.Diagnostics.Debug.WriteLine("Database record retrieval failed!");
                _mediator.ClearID();
                return;
            }

            _scanned = assignment;
            vehicleInformationUI.Items.Clear();
            vehicleInformationUI.Items.AddRange(new object[]
            {
                assignment, information
            });

            Invoke((MethodInvoker)(() =>
            {
                rescanUI.Enabled = true;
                processVehicleUI.Enabled = true;
                vehicleProcessStatusUI.Items.Add($"Scanned: {assignment.ID}");
            }));

            _mediator.Request();
        }
예제 #3
0
        static void Main(string[] args)
        {
            GarageAssignment assignment = GarageRepository.GetGarageAssignment("39009D3D68");

            Console.WriteLine($"{assignment.ID} {assignment.Stored} {assignment.Tier} {assignment.Cell}");
            GarageRepository.MoveVehicle("39009D3D68", false);
            assignment = GarageRepository.GetGarageAssignment("39009D3D68");
            Console.WriteLine($"{assignment.ID} {assignment.Stored} {assignment.Tier} {assignment.Cell}");
            Console.ReadKey();
        }
예제 #4
0
 private void killServersUI_Click(object sender, EventArgs e)
 {
     _mediator.RequestKill();
     _scanned = null;
     killServersUI.Enabled    = false;
     processVehicleUI.Enabled = false;
     rescanUI.Enabled         = false;
     startServersUI.Enabled   = false;
     resetServersUI.Enabled   = true;
     UpdateSystemStatus();
 }
예제 #5
0
        static void Main(string[] args)
        {
            var repo = GarageRepository.Instance;

            GarageAssignment assignment = repo.GetGarageAssignment("39009D3D68");

            Console.WriteLine($"{assignment.ID}, {assignment.Stored}, {assignment.Cell}");
            Console.WriteLine(repo.MoveVehicle("39009D3D68", false));
            assignment = repo.GetGarageAssignment("39009D3D68");
            Console.WriteLine($"{assignment.ID}, {assignment.Stored}, {assignment.Cell}");
            Console.WriteLine(repo.GetGaragePopulation());
            Console.ReadKey();
        }
예제 #6
0
        private void _mediator_IDScanned(object sender, GarageAssignment assignment, VehicleInformation information)
        {
            if (assignment == null || information == null)
            {
                vehicleProcessStatusUI.Items.Add("Scanned: Invalid ID");
                rescanUI.Enabled = true;
                return;
            }

            _scanned = assignment;
            vehicleInformationUI.Items.Clear();
            vehicleInformationUI.Items.AddRange(new object[]
            {
                assignment, information
            });

            rescanUI.Enabled         = true;
            processVehicleUI.Enabled = true;
            vehicleProcessStatusUI.Items.Add($"Scanned: {assignment.ID}");
        }
예제 #7
0
        private void killServersUI_Click(object sender, EventArgs e)
        {
            try
            {
                _mediator.Kill();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            _scanned = null;
            killServersUI.Enabled    = false;
            processVehicleUI.Enabled = false;
            rescanUI.Enabled         = false;
            startServersUI.Enabled   = true;
            _mediator = new GarageMediator.GarageMediator();
            UpdateSystemStatus();
        }
예제 #8
0
 private void rescanUI_Click(object sender, EventArgs e)
 {
     _scanned = null;
     _mediator.RequestClearID();
     UpdateSystemStatus();
 }
예제 #9
0
 public override void ProcessVehicle(GarageAssignment assignment)
 {
     _instructor = Task.Run(() => _Process(assignment));
 }
예제 #10
0
 public virtual void ProcessVehicle(GarageAssignment assignment)
 {
     throw new InvalidOperationException();
 }
예제 #11
0
 public virtual void ProcessVehicle(GarageAssignment assignment)
 {
 }
예제 #12
0
 public void RequestProcessVehicle(GarageAssignment assignment)
 {
     State.ProcessVehicle(assignment);
 }