Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        //=======================================================================
        /// <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);
        }
Ejemplo n.º 3
0
 //=======================================================================
 /// <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);
     }
 }
Ejemplo n.º 4
0
 //=======================================================================
 public override object ConvertFrom(ITypeDescriptorContext context,
                                    System.Globalization.CultureInfo culture, object value)
 {
     return(IbPrimaryKey.Parse(value.ToString()));
 }
Ejemplo n.º 5
0
 //=======================================================================
 public static IbPrimaryKey FromRow(DataRowView dataRowView)
 {
     return(IbPrimaryKey.FromRow(dataRowView.Row));
 }