для Пример, если я хочу добавить расширение в консоли , называется '
Код: Выделить всё
WriteBlueLineКод: Выделить всё
Console.WriteBlueLine("This text is blue");
Код: Выделить всё
thisКод: Выделить всё
public static class Helpers {
public static void WriteBlueLine(this Console c, string text)
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(text);
Console.ResetColor();
}
}
< /code>
Это не добавило 'WriteBlueLineПодробнее здесь: https://stackoverflow.com/questions/249 ... atic-class
Мобильная версия