Пример #1
0
        public override int EnumPorts(out IEnumDebugPorts2 ppEnum)
        {
            ConnectionInfoStore store = new ConnectionInfoStore();

            IDebugPort2[] ports = new IDebugPort2[store.Connections.Count];

            for (int i = 0; i < store.Connections.Count; i++)
            {
                ConnectionInfo connectionInfo = (ConnectionInfo)store.Connections[i];
                ports[i] = new SSHPort(this, GetFormattedSSHConnectionName(connectionInfo), isInAddPort: false);
            }

            ppEnum = new AD7PortEnum(ports);
            return(HR.S_OK);
        }
Пример #2
0
        public override int AddPort(IDebugPortRequest2 request, out IDebugPort2 port)
        {
            string name;

            HR.Check(request.GetPortName(out name));

            AD7Port newPort = new SSHPort(this, name, isInAddPort: true);

            if (newPort.IsConnected)
            {
                port = newPort;
                return(HR.S_OK);
            }

            port = null;
            return(HR.E_REMOTE_CONNECT_USER_CANCELED);
        }