Exemplo n.º 1
0
        public bool Warning(string warnstr)
        {
            if (on && (int)loggingLevel > 1)
            {
                Console.WriteLine("WARNING: " + warnstr);

                if (showWindow)
                {
                    f_ErrorWindow errW = new f_ErrorWindow();

                    //TODO:SHOW ERROR
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public bool Error(string errorString, Exception _exception, bool showOnlyException)
        {
            if (on && (int)loggingLevel > 0)
            {
                Console.ForegroundColor = ConsoleColor.Red;

                if (_exception == null || !showOnlyException)
                {
                    Console.Error.WriteLine("ERROR: " + errorString);
                }

                if (_exception != null)
                {
                    Console.Error.WriteLine(_exception.ToString());
                }

                Console.ForegroundColor = ConsoleColor.Gray;

                if (showWindow)
                {
                    f_ErrorWindow errW = new f_ErrorWindow()
                    {
                        _messageType       = messageType.Error,
                        _messageHeader     = "ERROR",
                        _messageTitle      = "ERROR MESSAGE FROM SYSTEM",
                        _messageBody       = errorString,
                        _exception         = _exception,
                        _showOnlyException = showOnlyException
                    };
                    errW.ShowDialog();
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }