/// <summary> /// Tries to parse an IbPrimaryKey. /// </summary> /// <param name="keyString">The string to attempt to parse.</param> /// <param name="result">The resulting IbPrimaryKey.</param> /// <returns>True if the parse was successful, False otherwise.</returns></returns> public static bool TryParse(string keyString, out IbPrimaryKey result) { Exception parseException; result = parseInternal(keyString, false, out parseException); return(parseException == null); }
//======================================================================= /// <summary> /// Translates the string representation of a key into an instance. /// </summary> /// <param name="key">The string to parse.</param> /// <param name="ensureEncrypted">Throws an exception if the input string was not encrypted.</param> /// <returns>An IbPrimaryKey.</returns> public static IbPrimaryKey Parse(string keyString, bool ensureEncrypted) { Exception parseException; IbPrimaryKey result = parseInternal(keyString, ensureEncrypted, out parseException); if (parseException != null) { throw parseException; } return(result); }
//======================================================================= /// <summary> /// Indiactes whether two instances of IbPrimaryKey are equal in value. /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (obj is IbPrimaryKey) { IbPrimaryKey other = (IbPrimaryKey)obj; return(this.ID == other.ID); } else { return(false); } }
//======================================================================= public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { return(IbPrimaryKey.Parse(value.ToString())); }
//======================================================================= public static IbPrimaryKey FromRow(DataRowView dataRowView) { return(IbPrimaryKey.FromRow(dataRowView.Row)); }