コード例 #1
0
ファイル: InkTestBed.cs プロジェクト: zamorarr/ink
    // Handler used for both compiler and story errors
    void OnError(string message, Ink.ErrorType errorType)
    {
        ConsoleColor color = ConsoleColor.Red;

        if (errorType == ErrorType.Warning)
        {
            color = ConsoleColor.Blue;
        }
        else if (errorType == ErrorType.Author)
        {
            color = ConsoleColor.Green;
        }

        Console.ForegroundColor = color;
        Console.WriteLine(message);
        Console.ResetColor();
    }
コード例 #2
0
    void OnError(string message, Ink.ErrorType errorType)
    {
        switch (errorType)
        {
        case ErrorType.Author:
            _authorMessages.Add(message);
            break;

        case ErrorType.Warning:
            _warnings.Add(message);
            break;

        case ErrorType.Error:
            _errors.Add(message);
            break;
        }
    }
コード例 #3
0
    // Handler used for both compiler and story errors
    void OnError(string message, Ink.ErrorType errorType)
    {
        ConsoleColor color = ConsoleColor.Red;

        if (errorType == ErrorType.Warning)
        {
            color = ConsoleColor.Blue;
        }
        else if (errorType == ErrorType.Author)
        {
            color = ConsoleColor.Green;
        }

        Console.ForegroundColor = color;
        Console.WriteLine(message);
        Console.ResetColor();

        // Throw an exception so we can get a callstack right here
        throw new SystemException(errorType.ToString() + ": " + message);
    }