/// <summary> /// 确定指定的对象是否等于当前对象 /// </summary> /// <param name="obj">要与当前对象进行比较的对象</param> /// <returns>如果指定的对象等于当前对象,则为 <code>true</code>,否则为 <code>false</code></returns> public override bool Equals(object obj) { CQCode code = obj as CQCode; if (code != null) { return(string.Equals(this._originalString, code._originalString)); } return(base.Equals(obj)); }
/// <summary> /// 判断是否是语音 <see cref="CQCode"/> /// </summary> /// <param name="code">要判断的 <see cref="CQCode"/> 实例</param> /// <returns>如果是语音 <see cref="CQCode"/> 返回 <see langword="true"/> 否则返回 <see langword="false"/></returns> public static bool EqualIsRecordCQCode(CQCode code) { return(code.Function == CQFunction.Record); }
/// <summary> /// 判断是否是图片 <see cref="CQCode"/> /// </summary> /// <param name="code">要判断的 <see cref="CQCode"/> 实例</param> /// <returns>如果是图片 <see cref="CQCode"/> 返回 <see langword="true"/> 否则返回 <see langword="false"/></returns> public static bool EqualIsImageCQCode(CQCode code) { return(code.Function == CQFunction.Image); }