wpf_player.AudioPlayerModel.setResource C# (CSharp) Method

setResource() private method

Sets the current handling resource. If the player is handling the same resource then the methods call restartStream otherwise it calls setupLocalStream
private setResource ( KademliaResource rsc ) : void
rsc Persistence.KademliaResource Resource that has to be handled
return void
        private void setResource(KademliaResource rsc)
        {
            this.stop();
            if (rsc == null) return;
            if ((this.rsc != null) && (rsc.Id.Equals(this.rsc.Id)))
            {
                restartStream();
            }
            else
            {
                this.rsc = rsc;
                setupLocalStream(this.rsc, 0);
            }
        }