예제 #1
0
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String" /> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            PropertyInfo propertyInfo = this.GetType().GetProperty("reason");

            if (propertyInfo != null)
            {
                string propertyName  = propertyInfo.PropertyType.Name;
                string propertyValue = propertyInfo.GetValue(this, null).ToString();
                string key           = propertyName + "." + propertyValue;
                string description   = ErrorDescriptions.Lookup(key);
                return(string.Format("{0}. (Error: {1}.{2}, FieldPath: {3}, Trigger: {4})", description,
                                     this.GetType().Name, propertyValue, this.fieldPath, this.trigger));
            }
            return(base.ToString());
        }
예제 #2
0
 /// <summary>
 /// Вывод ошибки
 /// </summary>
 /// <param name="error">Ошибка</param>
 private void ListError(Error error)
 {
     _context.SourceCodeDispatcher.WriteLine($"*{_context.ErrorNumber++.ToString().PadLeft(3, '0')}* {"^".PadLeft(error.Position)}ошибка код {error.Code}");
     _context.SourceCodeDispatcher.WriteLine($"***** {ErrorDescriptions.Get(error.Code)}");
 }