Пример #1
0
        internal static void Error(string message, Exception exception)
        {
            Write(message + Environment.NewLine + "Exception: " + exception, LoggerCategory.NBugError);

            if (Settings.DisplayDeveloperUI)
            {
                using (var viewer = new InternalExceptionViewer())
                {
                    viewer.ShowDialog(exception);
                }
            }

            if (Settings.ThrowExceptions)
            {
                throw new NBugRuntimeException(message, exception);
            }
        }
Пример #2
0
        internal static void Error <T>(Expression <Func <T> > propertyExpression, string message)
        {
            Write(message + " Misconfigured Property: " + ((MemberExpression)propertyExpression.Body).Member.Name, LoggerCategory.NBugError);

            if (Settings.DisplayDeveloperUI)
            {
                using (var viewer = new InternalExceptionViewer())
                {
                    viewer.ShowDialog(NBugConfigurationException.Create(propertyExpression, message));
                }
            }

            if (Settings.ThrowExceptions)
            {
                throw NBugConfigurationException.Create(propertyExpression, message);
            }
        }
Пример #3
0
        internal static void Error(string message)
        {
            Write(message, LoggerCategory.NBugError);

            if (Settings.DisplayDeveloperUI)
            {
                using (var viewer = new InternalExceptionViewer())
                {
                    viewer.ShowDialog(new NBugRuntimeException(message));
                }
            }

            if (Settings.ThrowExceptions)
            {
                throw new NBugRuntimeException(message);
            }
        }