internal void Attach(WumpusGatewayClient client) { client.Ready += d => { if (Guilds.IsEnabled) { Guilds.HandleReady(d); } //if (Channels.IsEnabled) Channels.HandleReady(d); //if (Users.IsEnabled) Users.HandleReady(d); SessionReady?.Invoke(); }; client.SessionLost += () => { if (Guilds.IsEnabled) { Guilds.HandleSessionLost(); } //if (Channels.IsEnabled) Guilds.HandleSessionLost(); //if (Users.IsEnabled) Guilds.HandleSessionLost(); SessionLost?.Invoke(); }; if (Guilds.IsEnabled) { client.GuildCreate += d => Guilds.HandleGuildCreate(d); client.GuildUpdate += d => Guilds.HandleGuildUpdate(d); client.GuildDelete += d => Guilds.HandleGuildDelete(d); client.GuildEmojisUpdate += d => Guilds.HandleGuildEmojisUpdate(d); client.GuildIntegrationsUpdate += d => Guilds.HandleGuildIntegrationsUpdate(d); client.WebhooksUpdate += d => Guilds.HandleGuildWebhooksUpdate(d); } }
private void SetSession(Utf8String sessionId) { if (_sessionId != sessionId) { if (!(_sessionId is null) && sessionId is null) { SessionLost?.Invoke(); } else if (_sessionId is null && !(sessionId is null)) { SessionCreated?.Invoke(); }
private void Consumer_SessionLost(TemperatureSensorConsumer sender, Windows.Devices.AllJoyn.AllJoynSessionLostEventArgs args) { SessionLost?.Invoke(this, new EventArgs()); }
private void Consumer_SessionLost(ShadesConsumer sender, AllJoynSessionLostEventArgs args) { SessionLost?.Invoke(this, new EventArgs()); }
void alljoyn_sessionlistener_sessionlost(IntPtr context, IntPtr sessionId, alljoyn_sessionlostreason reason) { SessionLost?.Invoke(this, EventArgs.Empty); }