public IRemoteProcess Create(RemoteProcess remoteProcessDto)
        {
            Contract.Requires<ArgumentNullException>(remoteProcessDto != null);

            IPlayer player = null;
            if (remoteProcessDto.Player != null)
            {
                if (string.IsNullOrWhiteSpace(remoteProcessDto.Player.Name))
                {
                    throw new InvalidOperationException();
                }

                player = this.playerFactory.Create(remoteProcessDto.Player);
            }

            var remoteProcess = new RemoteProcessViewModel(
                remoteProcessDto.Id, remoteProcessDto.RemoteId, player, this.bus);
            return remoteProcess;
        }
예제 #2
0
        public IRemoteProcess Create(RemoteProcess remoteProcessDto)
        {
            Contract.Requires <ArgumentNullException>(remoteProcessDto != null);

            IPlayer player = null;

            if (remoteProcessDto.Player != null)
            {
                if (string.IsNullOrWhiteSpace(remoteProcessDto.Player.Name))
                {
                    throw new InvalidOperationException();
                }

                player = this.playerFactory.Create(remoteProcessDto.Player);
            }

            var remoteProcess = new RemoteProcessViewModel(
                remoteProcessDto.Id, remoteProcessDto.RemoteId, player, this.bus);

            return(remoteProcess);
        }