internal static void RegisterTypeListener(SessionListener listener) { // Get a single bit number representing the session type. ulong key = GetIdentifier(listener.BroadcastingType).sessionOnly; // Look for existing sessions that match this type. foreach (var session in Sessions) { if (listener.BroadcastingType.GetTypeInfo().IsAssignableFrom(session.GetType().GetTypeInfo()) && listener.Matchsession(session)) { listener.HookSession(session, false); } } // Ensure that this type is in the listener table. if (!listenerTypeLookup.ContainsKey(key)) { listenerTypeLookup[key] = new List <SessionListener>(); } // Add the listener to the lookup table. listenerTypeLookup[key].Add(listener); }
public Path(SessionListener listener, string pathToSession) { this._listener = listener; this.PathTosession = pathToSession; }