public Boolean Equals(Win32ResourceName other) { if (Object.ReferenceEquals(this, other)) { return(true); } if (Object.ReferenceEquals(other, null)) { return(false); } if (!ParentType.Equals(other.ParentType)) { return(false); } if (NameInt > -1 && NameInt == other.NameInt) { return(true); // Name is greater than -1 (use string) and numerical Name id is the same } if (NameInt == -1 && other.NameInt == -1) { return(NameStr.Equals(other.NameStr)); } return(false); }
public override Int32 GetHashCode() { if (NameStr == null) { return(ParentType.GetHashCode() ^ NameInt.GetHashCode()); } return(ParentType.GetHashCode() ^ NameStr.GetHashCode() ^ NameInt.GetHashCode()); }
private void GetPageStr() { Send_Get Get = new Send_Get(LoginInfo.SetUrl(LoginInfo.CommentCode)); if (Get.Get_Status() == true) { PageStr = Get.Get_Output(); if (PageStr.IndexOf("已经评价过") != -1) { MessageBox.Show("已经完成评价任务,无需评教!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else if (PageStr.IndexOf("已关闭") != -1) { MessageBox.Show("评教系统已关闭,请与相关部门联系!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } else { PageStr = "网络错误,请稍后重试!"; return; } string TableStr = TableRegex.Match(PageStr).Value; MatchCollection ClassMatch = ClassRegex.Matches(TableStr); foreach (Match i in ClassMatch) { if (i.Value.IndexOf("onclick") == -1) { continue; } NameStr.Add(NameRegex.Match(i.Value).Value.Replace("<td>", "").Replace("</td>", "")); //课程名称 LinkStr.Add(LinkRegex.Match(i.Value).Value.Replace("window.open('", "").Replace("'", "")); //链接 if (i.Value.IndexOf("已评价") == -1) { IsComment.Add(false); } else { IsComment.Add(true); } } }
// public Int32 CompareTo(NameValuePair other) { return(NameStr.CompareTo(other.NameStr)); }