Ejemplo n.º 1
0
        public void Connect(ServerInfo serverInfo)
        {
            SelectRemoteMachineEventArgs args = new SelectRemoteMachineEventArgs(serverInfo);

            SelectRemoteMachine?.Invoke(this, args);

            RemoteMachine remoteMachine = args.SelectedMachine;

            if (remoteMachine == null)
            {
                return;
            }

            _model.AddMachine(remoteMachine);
            UpdateRecentServersSettings();

            ActiveMachine = remoteMachine;
        }
Ejemplo n.º 2
0
        public RemoteViewModel(ServerInfo serverInfo, IRemote remote)
        {
            _serverInfo        = serverInfo;
            _enableLivePreview = false;

            _remote = remote;

            _machineNames = new ObservableCollection <string>();

            _remote.ReceiveAvailableMachines += m =>
            {
                _machineNames.Clear();

                foreach (string machineName in m)
                {
                    _machineNames.Add(machineName);
                }
            };

            _remote.SendRequestAvailableMachines();

            _machine = new RemoteMachine(_remote);
        }