Exemplo n.º 1
0
 protected void ConnectToVMWare(VMWareVirtualHost aHost) {
   if (mEdition != VMwareEdition.Player) {
     aHost.ConnectToVMWareWorkstation();
   } else {
     aHost.ConnectToVMWarePlayer();
   }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Connected virtual machine host.
        /// </summary>
        protected VMWareVirtualHost GetConnectedHost()
        {
            VMWareVirtualHost host = new VMWareVirtualHost();

            switch (_type)
            {
            case VMWareVirtualHost.ServiceProviderType.Player:
                Log.LogMessage("Connecting to VMWare Player");
                host.ConnectToVMWarePlayer(_connectTimeout);
                break;

            case VMWareVirtualHost.ServiceProviderType.Server:
                Log.LogMessage(string.Format("Connecting to VMWare Server '{0}'",
                                             string.IsNullOrEmpty(_host) ? "localhost" : _host));
                host.ConnectToVMWareServer(_host, _hostUsername, _hostPassword, _connectTimeout);
                break;

            case VMWareVirtualHost.ServiceProviderType.VirtualInfrastructureServer:
                Log.LogMessage(string.Format("Connecting to VMWare VI server '{0}'",
                                             _host));
                host.ConnectToVMWareVIServer(_host, _hostUsername, _hostPassword, _connectTimeout);
                break;

            case VMWareVirtualHost.ServiceProviderType.Workstation:
                Log.LogMessage("Connecting to VMWare Workstation");
                host.ConnectToVMWareWorkstation(_connectTimeout);
                break;

            default:
                Log.LogError(string.Format("Invalid connection type: {0}", _type));
                throw new InvalidOperationException(string.Format("Invalid connection type: {0}", _type));
            }

            return(host);
        }
Exemplo n.º 3
0
 protected void ConnectToVMWare(VMWareVirtualHost aHost)
 {
     if (mEdition != VMwareEdition.Player)
     {
         aHost.ConnectToVMWareWorkstation();
     }
     else
     {
         aHost.ConnectToVMWarePlayer();
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Connected virtual machine host.
        /// </summary>
        protected VMWareVirtualHost GetConnectedHost()
        {
            VMWareVirtualHost host = new VMWareVirtualHost();

            switch (_type)
            {
                case VMWareVirtualHost.ServiceProviderType.Player:
                    Log.LogMessage("Connecting to VMWare Player");
                    host.ConnectToVMWarePlayer(_connectTimeout);
                    break;
                case VMWareVirtualHost.ServiceProviderType.Server:
                    Log.LogMessage(string.Format("Connecting to VMWare Server '{0}'",
                        string.IsNullOrEmpty(_host) ? "localhost" : _host));
                    host.ConnectToVMWareServer(_host, _hostUsername, _hostPassword, _connectTimeout);
                    break;
                case VMWareVirtualHost.ServiceProviderType.VirtualInfrastructureServer:
                    Log.LogMessage(string.Format("Connecting to VMWare VI server '{0}'",
                        _host));
                    host.ConnectToVMWareVIServer(_host, _hostUsername, _hostPassword, _connectTimeout);
                    break;
                case VMWareVirtualHost.ServiceProviderType.Workstation:
                    Log.LogMessage("Connecting to VMWare Workstation");
                    host.ConnectToVMWareWorkstation(_connectTimeout);
                    break;
                case VMWareVirtualHost.ServiceProviderType.WorkstationShared:
                    Log.LogMessage("Connecting to VMWare Workstation (shared)");
                    host.ConnectToVMWareWorkstationShared(_connectTimeout);
                    break;
                default:
                    Log.LogError(string.Format("Invalid connection type: {0}", _type));
                    throw new InvalidOperationException(string.Format("Invalid connection type: {0}", _type));
            }

            return host;
        }