コード例 #1
0
        public RemoteOnlineService()
        {
            _pubsub          = PubSubEvents.Singleton;
            _clientGroupList = ClientGroupCollection.Instance;
            _clientGroupList[MagicStrings.DefaultGroup].OnlineClients = DefaultClientList;
            _remoteUpdateSenderAdapterDic = new Dictionary <int, FileSendProxy>();
            _pushService = OperationContext.Current.GetCallbackChannel <IPushServiceCallback>();
            _tokenList   = new ClientTokenList();
            ServerPushList.Add(_pushService);
            var scEvent = new ServiceCreatedEvent <RemoteOnlineService>(this);

            _pubsub.Publish(scEvent);
        }
コード例 #2
0
        private void RemoteServicePush_UserOnlineStateChanged(ClientToken obj)
        {
            Console.WriteLine($"RemotePush {obj.NickName} {obj.OnlineState}");
            var client = ClientTokenList.Find(OnlineClients.ToList(), obj);

            if (client == null)
            {
                OnlineClients.Add(obj);
            }
            else
            {
                ClientToken.PropertyCopy(obj, client);
            }
        }