public void Clear() { CustomEvents.Clear(); ErrorEvents.Clear(); MessageEvents.Clear(); WarningsEvents.Clear(); }
public static void SetUpEvents(this DiscordClient client) { client.Ready += async(s, _) => { Console.WriteLine("CocaBot on!"); }; client.ComponentInteractionCreated += (_, eventArgs) => Task.Run(() => ComponentInteractionEvents.XpGraphs(eventArgs)); if (!Program.prod) { return; } client.Ready += (client, _) => { Task.Run(async() => { await TimedEvents.SetTimer(client); }); return(Task.CompletedTask); }; client.MessageCreated += (_, eventArgs) => Task.Run(() => MessageEvents.HandleMessage(Program.UBIKey, eventArgs)); }
public void AppendEvent(VizqlEvent vizqlEvent) { if (String.IsNullOrEmpty(vizqlEvent.VizqlSessionId)) { vizqlEvent.VizqlSessionId = VizqlSessionId; } //Performance if (vizqlEvent.GetElapsedTimeInSeconds().HasValue) { PerformanceEvents.Add(new VizqlPerformanceEvent(vizqlEvent)); } //Error if (vizqlEvent is VizqlErrorEvent) { ErrorEvents.Add(vizqlEvent as VizqlErrorEvent); } //Connections else if (vizqlEvent is VizqlConstructProtocol) { ConstructProtocolEvents.Add(vizqlEvent as VizqlConstructProtocol); } else if (vizqlEvent is VizqlConstructProtocolGroup) { ConstructProtocolGroupEvents.Add(vizqlEvent as VizqlConstructProtocolGroup); } else if (vizqlEvent is VizqlDsConnect) { DsConnectEvents.Add(vizqlEvent as VizqlDsConnect); } //Caching else if (vizqlEvent is VizqlEcDrop) { EcDropEvents.Add(vizqlEvent as VizqlEcDrop); } else if (vizqlEvent is VizqlEcLoad) { EcLoadEvents.Add(vizqlEvent as VizqlEcLoad); } else if (vizqlEvent is VizqlEcStore) { EcStoreEvents.Add(vizqlEvent as VizqlEcStore); } else if (vizqlEvent is VizqlEqcLoad) { EqcLoadEvents.Add(vizqlEvent as VizqlEqcLoad); } else if (vizqlEvent is VizqlEqcStore) { EqcStoreEvents.Add(vizqlEvent as VizqlEqcStore); } //Query else if (vizqlEvent is VizqlDsInterpretMetadata) { DsInterpretMetadataEvents.Add(vizqlEvent as VizqlDsInterpretMetadata); } else if (vizqlEvent is VizqlEndQuery) { EndQueryEvents.Add(vizqlEvent as VizqlEndQuery); } else if (vizqlEvent is VizqlQpBatchSummary) { QpBatchSummaryEvents.Add(vizqlEvent as VizqlQpBatchSummary); } else if (vizqlEvent is VizqlQpQueryEnd) { QpQueryEndEvents.Add(vizqlEvent as VizqlQpQueryEnd); } else if (vizqlEvent is VizqlEndPrepareQuickFilterQueries) { EndPrepareQuickFilterQueriesEvents.Add(vizqlEvent as VizqlEndPrepareQuickFilterQueries); } else if (vizqlEvent is VizqlEndSqlTempTableTuplesCreate) { EndSqlTempTableTuplesCreateEvents.Add(vizqlEvent as VizqlEndSqlTempTableTuplesCreate); } else if (vizqlEvent is VizqlSetCollation) { SetCollationEvents.Add(vizqlEvent as VizqlSetCollation); } else if (vizqlEvent is VizqlProcessQuery) { ProcessQueryEvents.Add(vizqlEvent as VizqlProcessQuery); } //Compute else if (vizqlEvent is VizqlEndComputeQuickFilterState) { EndComputeQuickFilterStateEvents.Add(vizqlEvent as VizqlEndComputeQuickFilterState); } //Render else if (vizqlEvent is VizqlEndUpdateSheet) { EndUpdateSheetEvents.Add(vizqlEvent as VizqlEndUpdateSheet); } //Message else if (vizqlEvent is VizqlMessage) { MessageEvents.Add(vizqlEvent as VizqlMessage); } //Etc else if (vizqlEvent is VizqlEtc) { EtcEvents.Add(vizqlEvent as VizqlEtc); } }
/// <summary> /// Alle registrierten Event-Handler über /// eine neue Mitteilung informieren /// </summary> /// <param name="Message"></param> public void NewMessage(string Message) { MessageEvents?.Invoke(Message); }
public void LogMessageEvent(BuildMessageEventArgs e) { MessageEvents.Add(e); }