Esempio n. 1
0
        public ObjectSynchronizationContext GetContext <T>(ObjectSynchronizationHub <T> hub) where T : class, IObjectSynchronizationHubClient
        {
            lock (_lock)
            {
                ObjectSynchronizationContext syncManager;

                if (_syncManagers.TryGetValue(hub.GetType(), out syncManager))
                {
                    return(syncManager);
                }
                else
                {
                    syncManager = new ObjectSynchronizationContext(hub);
                    _syncManagers.Add(hub.GetType(), syncManager);
                    return(syncManager);
                }
            }
        }
Esempio n. 2
0
 public ObjectSynchronizationClient(ObjectSynchronizationContext context, string connectionId)
 {
     _context      = context;
     _connectionId = connectionId;
 }