Exemple #1
0
        private async Task OnQuery(object source, EventArgs e)
        {
            if (Queried == null)
            {
                return;
            }

            await Queried.Invoke(source, e);
        }
Exemple #2
0
        /// <inheritdoc />
        /// <summary>
        ///     Queries the channel with the specified character spawn.
        /// </summary>
        /// <param name="characterSpawn">The character spawn.</param>
        public void Query(ICharacterSpawn characterSpawn)
        {
            QueryingChannelEventArgs queryingChannelEventArgs = new QueryingChannelEventArgs(characterSpawn);

            Querying?.Invoke(this, queryingChannelEventArgs);
            if (queryingChannelEventArgs.Cancel)
            {
                return;
            }

            QueriedChannelEventArgs queriedChannelEventArgs = new QueriedChannelEventArgs(characterSpawn);

            Queried?.Invoke(this, queriedChannelEventArgs);
        }