public void AddContestant(ContestantVM vm) { vm.IsShowAverageScore = this.IsShowAverageScore; vm.IsShowTotalScore = this.IsShowTotalScore; vm.IsShowRaterCount = this.IsShowRaterCount; vm.IsShowIntroduction = this.IsShowIntroduction; vm.IsShowRaterListButton = this.IsShowRaterListButton; vm.CommandAction += On_Contestant_CommandAction; _contestantColle.Add(vm); }
private bool On_Contestant_CommandAction(string cmdKey, ContestantVM sender) { switch (cmdKey) { case nameof(sender.CmdRemove): RemoveContestant(sender); break; default: break; } return(true); }
public void Stop() { //停止紀錄時間 if (_timerElapseTime != null) { _timerElapseTime.Change(Timeout.Infinite, Timeout.Infinite); _timerElapseTime.Dispose(); _timerElapseTime = null; } this.IsStarted = false; this.CanChangeRateEnable = true; ContestantVM contestant = new ContestantVM(); contestant.ImageObject = this.ImageObject; contestant.Name = this.ContestantName; contestant.AverageScore = this.AverageScore; contestant.TotalScore = this.TotalScore; contestant.RaterCount = this.RaterCount; contestant.AddRater(_raterColle); _contestantList.AddContestant(contestant); }
public void RemoveContestant(ContestantVM vm) { vm.CommandAction -= On_Contestant_CommandAction; _contestantColle.Remove(vm); }