public override string ToString() { StringBuilder sb = new StringBuilder(); // the option variable starts with VAR or USERVAR sb.Append(VarCode.ToString()); // the variable name if (this.NameBytes.Length > 0) { sb.Append(" "); if (this.IsSeedVar == true) { sb.Append("IBMRSEED " + this.SeedValue.ToHex(' ')); } else { sb.Append(this.NameBytes.ToAscii()); } } if ((this.ValueBytes != null) && (this.ValueBytes.Length > 0)) { sb.Append(" VALUE "); var nameText = this.NameAsText; var valueText = this.ValueBytes.ToAscii(); if (nameText != null) { if ((nameText == "IBMRSEED") || (nameText == "IBMSUBSPW")) { valueText = this.ValueBytes.ToHex(' '); } } sb.Append(valueText); } else if (this.ValueEmpty == true) { sb.Append(" VALUE "); } return(sb.ToString()); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"/>. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { return(DataSource.GetHashCode() ^ SiteName.GetHashCode() ^ (ValueCount != null ? ValueCount.GetHashCode() : 0) ^ ServiceDesciptionUrl.GetHashCode() ^ VarCode.GetHashCode()); }