コード例 #1
0
        static void Main()
        {
            string s = "Hello Extension Methods";
            int    i = s.WordCount();

            MyAwesomeToolbox.PrettyPrint($"Is it more than 100 words? : {i.IsGreaterThan100()}", ConsoleColor.Cyan, 2);
            MyAwesomeToolbox.PrettyPrint(i.ToString(), ConsoleColor.Magenta, 1);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            string s = "Extension methods are wicked cool!";

            MyAwesomeToolbox.PrettyPrint("Static is very cool!", ConsoleColor.Cyan, 2);
            MyAwesomeToolbox.PrettyPrint("Static can be fun after rubbing carpet! :)", ConsoleColor.Yellow, 1);
            MyAwesomeToolbox.PrettyPrint(MyAwesomeToolbox.ProduceLuckyNumber().ToString(), ConsoleColor.Green, 4);

            Automobile auto = new Automobile();

            auto.Drive();
            auto.DriveElectric();
        }