Esempio n. 1
0
        public override Task OnOpened()
        {
            if (this.HasParameterKey("ctx"))
            {
                this.Context = Guid.Parse(this.GetParameter("ctx"));
            }
            else
            {
                this.Context = Guid.NewGuid();
            }

            // If there is no FakePeer, create a new one...
            if (this.Peer == null)
            {
                this.Peer           = new FakePeerModel();
                this.Peer.Id        = Guid.NewGuid();
                this.Peer.UserName  = "******";
                this.Peer.Context   = this.Context;
                this.Peer.GroupName = "Global";

                _persistenceModel.AddPeerModel(Peer);
            }

            this.Invoke(new { Id = this.Id, Context = this.Context, UserName = this.UserName, GroupName = this.GroupName }, "onContext");

            return(base.OnOpened());
        }
Esempio n. 2
0
        public void UpdatePeerModel(FakePeerModel peermodel)
        {
            FakePeerModel result = this.PeerModels.Find(item => item.Id == peermodel.Id);

            if (result != null)
            {
                result.UserName  = peermodel.UserName;
                result.GroupName = peermodel.GroupName;
            }
        }
Esempio n. 3
0
        // use fake peer model as the user model......
        public async Task SetUserNameAndGroupName(FakePeerModel peermodel)
        {
            this.Peer.UserName  = peermodel.UserName;
            this.Peer.GroupName = peermodel.GroupName;

            if (peermodel.Id != Guid.Empty)
            {
                this.Peer.Id = peermodel.Id;
            }
            _persistenceModel.UpdatePeerModel(this.Peer);

            await this.Invoke(this.Peer, "usernamegroupnameChange");
        }
Esempio n. 4
0
 public void AddPeerModel(FakePeerModel peermodel)
 {
     //UserModel result = this.PeerModels.Find(item => item.Id == usermodel.Id);
     //if (result != null)
     //{
     //	result.UserName = usermodel.UserName;
     //	result.GroupName = usermodel.GroupName;
     //
     //	if (usermodel.VideoId != Guid.Empty)
     //	{
     //		result.VideoId = usermodel.VideoId;
     //	}
     //} else
     //{
     this.PeerModels.Add(peermodel);
     //}
 }