Пример #1
0
        /// <summary>
        /// Constructor using an error string.
        /// </summary>
        /// <param name="error"></param>
        internal SharpHsqlException(string error) : this()
        {
            if (error == null)
            {
                throw new ArgumentNullException("error");
            }

            int number = 0;

            try
            {
                                #if !POCKETPC
                if (Char.IsDigit(error, 0))
                                #else
                if (Char.IsDigit(error.ToCharArray()[0]))
                                #endif
                { number = int.Parse(error.Substring(0, 5)); }
                else
                {
                    number = int.Parse(error.Substring(1, 4));
                }
            }
            catch {}

            string message = error;

            SharpHsqlError e = new SharpHsqlError(message, number, String.Empty, String.Empty);

            this.Errors.Add(e);
        }
 /// <summary>
 /// Strong typed version of the Add method for adding <see cref="SharpHsqlError"/>
 /// objects to the collection.
 /// <seealso cref="SharpHsqlError"/>
 /// <seealso cref="SharpHsqlException"/>
 /// </summary>
 /// <param name="error"></param>
 public void Add(SharpHsqlError error)
 {
     base.InnerList.Add(error);
 }