Exemplo n.º 1
0
        public void UpdateMachines()
        {
            var newMachines = machineLocator.ListMachines() ?? Array.Empty <IMachineMetadata>();

            if (!newMachines.OrderBy(m => m.Uuid).SequenceEqual(machines.OrderBy(m => m.Uuid)))
            {
                var newCollection = newMachines;
                var oldCollection = machines;

                machines = newCollection;

                OnMachineStateChange?.Invoke(this, new MachineStateChangeEventArgs(oldCollection, newCollection));
            }
        }
        public void UpdateMachines()
        {
            var newMachines = machineLocator.ListMachines();

            // If we get null the VirtualBox instance was invalid.  There is no point updating the machine state if we
            // can't obtain it.
            if (newMachines == null)
            {
                return;
            }

            if (!newMachines.OrderBy(m => m.Uuid).SequenceEqual(machines.OrderBy(m => m.Uuid)))
            {
                var newCollection = newMachines;
                var oldCollection = machines;

                machines = newCollection;

                OnMachineStateChange?.Invoke(this, new MachineStateChangeEventArgs(oldCollection, newCollection));
            }
        }