예제 #1
0
        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 };
            }
        }
예제 #2
0
 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;
 }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
 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();
        }
예제 #6
0
 public MachineWrapper(MainWindow w, VirtualBox.IMachine m)
 {
     _Machine = m;
     _Window = w;
     EnableCommand = new EnableDisableCommand(this, true);
     DisableCommand = new EnableDisableCommand(this, false);
 }
예제 #7
0
 public ShutDownFailure(IMongoDatabase db, VirtualBox vbox)
 {
     this.db   = db;
     this.vbox = vbox;
 }
예제 #8
0
 public void OnSessionStateChange(string sessionId, VirtualBox.SessionState state)
 {
 }
예제 #9
0
 public void OnMediumRegistered(string mediumId, VirtualBox.DeviceType type, int registered)
 {
 }
		public void OnMachineStateChange(string uuid, VirtualBox.MachineState state)
		{
		}