Пример #1
0
 public ConcurrentModificationException() : base(Localize.From("A concurrect access was detected during modification."))
 {
 }
Пример #2
0
 public ReadOnlyException() : base(Localize.From("An attempt was made to modify a read-only object."))
 {
 }
Пример #3
0
 public static void ThrowOutOfRange(string argName, int value, int min, int max)
 {
     throw new ArgumentOutOfRangeException(argName, Localize.From(@"Argument ""{0}"" value '{1}' is not within the expected range ({2}...{3})", argName, value, min, max));
 }
Пример #4
0
 public InvalidStateException() : base(Localize.From("This object is in an invalid state."))
 {
 }
Пример #5
0
 public void Write(Severity type, object context, string format)
 {
     WriteCore(type, context, Localize.From(format));
 }
Пример #6
0
        protected virtual ConsoleColor PickColor(Severity msgType, out string msgTypeText)
        {
            bool         implicitText = msgType < PrintSeverityAt;
            ConsoleColor color;

            if (msgType >= Severity.Critical)
            {
                color = ConsoleColor.Magenta;
            }
            else if (msgType >= Severity.Error)
            {
                color = ConsoleColor.Red;
            }
            else if (msgType >= Severity.Warning)
            {
                color = ConsoleColor.Yellow;
            }
            else if (msgType >= Severity.Note)
            {
                color = ConsoleColor.White;
            }
            else if (msgType >= Severity.Debug)
            {
                color = ConsoleColor.Cyan;
            }
            else if (msgType >= Severity.Verbose || msgType == Severity._Finer)
            {
                color = ConsoleColor.DarkCyan;
            }
            else if (msgType == Severity.Detail)
            {
                switch (_lastColor)
                {
                case ConsoleColor.Red: color = ConsoleColor.DarkRed; break;

                case ConsoleColor.Yellow: color = ConsoleColor.DarkYellow; break;

                case ConsoleColor.White: color = ConsoleColor.Gray; break;

                case ConsoleColor.Green: color = ConsoleColor.DarkGreen; break;

                case ConsoleColor.Blue: color = ConsoleColor.DarkBlue; break;

                case ConsoleColor.Magenta: color = ConsoleColor.DarkMagenta; break;

                case ConsoleColor.Cyan: color = ConsoleColor.DarkCyan; break;

                default: color = ConsoleColor.DarkGray; break;
                }
                msgTypeText = null;
                return(color);
            }
            else
            {
                color = Console.ForegroundColor;
            }

            msgTypeText = implicitText ? null : Localize.From(msgType.ToString());
            _lastColor  = color;
            return(color);
        }
Пример #7
0
 public void Write(Severity type, object context, string format, params object[] args)
 {
     WriteCore(type, context, Localize.From(format, args));
 }
Пример #8
0
 public void Write(Severity type, object context, string format, object arg0, object arg1 = null)
 {
     WriteCore(type, context, Localize.From(format, arg0, arg1));
 }
Пример #9
0
 public override string ToString()
 {
     return(Localize.From("(No value)"));
 }