private void submissionStatus_HyperlinkClicked(object sender, BrightIdeasSoftware.HyperlinkClickedEventArgs e) { JudgeStatus list = (JudgeStatus)e.Model; if (e.Column == pnumSUB || e.Column == ptitleSUB) { Interactivity.ShowProblem(list.pnum); } else if (e.Column == unameSUB) { if (LocalDatabase.ContainsUser(list.uname)) { Interactivity.ShowUserStat(list.uname); } else { if (MessageBox.Show("Add \"" + list.uname + "\" to your favorite list?", "Add User", MessageBoxButtons.YesNo) == DialogResult.No) { return; } RegistryAccess.AddUserid(list.uname, list.uid.ToString()); Interactivity.ShowUserStat(list.uname); } } }
private static void __DownloadUseridCompleted(DownloadTask task) { string uid = (string)task.Result; string name = (string)task.Token; task.Status = ProgressStatus.Failed; if (string.IsNullOrEmpty(uid)) { task.Error = new Exception("Connection error. Retry please."); } else if (uid.Trim() == "0") { task.Error = new Exception(name + " doesn't exist."); } else if (task.Error == null) { task.Status = ProgressStatus.Completed; } if (task.Status == ProgressStatus.Completed) { RegistryAccess.AddUserid(name, uid); string msg = "Username downloaded : {0} = {1}"; Interactivity.SetStatus(string.Format(msg, name, uid)); } }