BoxKite.Twitter.Console.ConsoleOutput.PrintMessage C# (CSharp) Метод

PrintMessage() публичный статический Метод

public static PrintMessage ( string text, ConsoleColor fgColour = ConsoleColor.Green ) : void
text string
fgColour ConsoleColor
Результат void
        public static void PrintMessage(string text, ConsoleColor fgColour = ConsoleColor.Green)
        {
            System.Console.ForegroundColor = fgColour;
            System.Console.WriteLine("{0}", text);
            System.Console.ResetColor();
        }

Usage Example

        public async Task <bool> DoApiTest(ITwitterSession session, List <int> testSeq)
        {
            var successStatus = true;

            try
            {
                // 1
                if (testSeq.Contains(1))
                {
                    ConsoleOutput.PrintMessage("ApiManagement\\GetCurrentAPIStatus", ConsoleColor.Gray);
                    var currentapi = await session.GetCurrentApiStatus();

                    if (currentapi.OK)
                    {
                        foreach (var x in currentapi.APIRateStatuses)
                        {
                            ConsoleOutput.PrintMessage(
                                String.Format("API on: {0} Calls: {1}/{2} Resets: {3}", x.Key, x.Value.Remaining, x.Value.Limit, x.Value.ResetTime));
                        }
                    }
                    else
                    {
                        successStatus = false;
                    }
                }
            }
            catch (Exception e)
            {
                ConsoleOutput.PrintError(e.ToString());
                return(false);
            }
            return(successStatus);
        }
All Usage Examples Of BoxKite.Twitter.Console.ConsoleOutput::PrintMessage