public Operation(vbCOM.IProgress progress) { Description = progress.OperationDescription; ID = progress.Id; try { Initiator = progress.Initiator.Id; } catch (Exception) { Initiator = null; } complete = progress.Completed; cancelable = progress.Cancelable; handle = progress; try { Error = new ErrorInfo(progress.ErrorInfo); } catch (Exception e) { Error = new ErrorInfo(null) { Description = "Couldn't get error info " + e.Message }; } }
public Machine(vbCOM.IMachine machine) { Name = machine.Name; comMachine = machine; MachineSession = new vbCOM.Session(); ID = machine.Id; MAC = machine.GetNetworkAdapter(0).MACAddress; //todo: handle multiple adapters CurrentProgress = null; }
static void Main(string[] args) { var vbox = new VirtualBox(); Console.WriteLine("VMs:"); foreach (var vm in vbox.TryListVms()) { Console.WriteLine(" {0} {1}", vm.Name.PadRight(30, ' '), vm.Guid); int n = 0; foreach (var kv in vbox.VmInfo(vm)) { if (++n > 10) { continue; } Console.WriteLine(" {0} {1}", kv.Key.PadRight(30, ' '), kv.Value); } } }
public PowerOffFailure(IMongoDatabase db, VirtualBox vbox) { this.db = db; this.vbox = vbox; }
public VirtualBoxProxy(ILogger <VirtualBoxProxy> logger) { this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); instance = new VirtualBox(); }
public MachineWrapper(MainWindow w, VirtualBox.IMachine m) { _Machine = m; _Window = w; EnableCommand = new EnableDisableCommand(this, true); DisableCommand = new EnableDisableCommand(this, false); }
public ShutDownFailure(IMongoDatabase db, VirtualBox vbox) { this.db = db; this.vbox = vbox; }
public void OnSessionStateChange(string sessionId, VirtualBox.SessionState state) { }
public void OnMediumRegistered(string mediumId, VirtualBox.DeviceType type, int registered) { }
public void OnMachineStateChange(string uuid, VirtualBox.MachineState state) { }