public void Handle(object bindedArgs, PacketStream stream, INetworkThread thread)
        {
            ApplicationViewModel viewModel    = (ApplicationViewModel)bindedArgs;
            Community            newCommunity = new Community(viewModel);

            newCommunity.Deserialize(stream.ReadStringList());
            viewModel.Communities.Add(newCommunity);
        }
示例#2
0
        public void Handle(object bindedArgs, PacketStream stream, INetworkThread thread)
        {
            ApplicationViewModel viewModel = (ApplicationViewModel)bindedArgs;
            long          idToEdit         = stream.ReadLong();
            List <string> newData          = stream.ReadStringList();
            Community     editedCommunity  = viewModel.Communities.FirstOrDefault(c => c.Id == idToEdit);

            editedCommunity?.Deserialize(newData);
        }
        public void Handle(object bindedArgs, PacketStream stream, INetworkThread thread)
        {
            ApplicationViewModel viewModel = (ApplicationViewModel)bindedArgs;
            int count = stream.ReadInt();

            for (int i = 0; i < count; i++)
            {
                Community community = new Community(viewModel);
                community.Deserialize(stream.ReadStringList());
                viewModel.Communities.Add(community);
            }
        }