예제 #1
0
        public Task Disconnect()
        {
            this.teamID               = 0;
            this.participantID        = 0;
            this.includeTeamDonations = false;

            this.team        = null;
            this.participant = null;

            this.cancellationTokenSource.Cancel();

            return(Task.FromResult(0));
        }
예제 #2
0
        private async Task <bool> InitializeInternal()
        {
            this.cancellationTokenSource = new CancellationTokenSource();

            this.team = await this.GetTeam();

            this.participant = await this.GetParticipant();

            if (this.team != null && this.participant != null)
            {
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                Task.Run(this.BackgroundDonationCheck, this.cancellationTokenSource.Token);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                return(true);
            }
            return(false);
        }