예제 #1
0
        static void Main(string[] args)
        {
            ConsoleColor c = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Hello World of MSBuild!");
            Console.ForegroundColor = c;
            Console.WriteLine(""); //Blank Line

            PrintTargetFramework();

            PrintBuildType();

            PrintBambooInfo();

            DemoClass dc = new DemoClass();

            dc.Name = "Demo Class";
            string   json = JsonConvert.SerializeObject(dc);
            Assembly jc   = typeof(JsonConvert).Assembly;

            Console.WriteLine("Newtonsoft.Json:           " + jc.FullName);


            Console.WriteLine(""); //Blank Line
            //Keep the console open to be able to see what it says if not run from a Command Window
            Console.WriteLine("Press Any Key to continue");
            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            ConsoleColor c = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Hello World of MSBuild!");
            Console.ForegroundColor = c;
            Console.WriteLine(""); //Blank Line

            PrintTargetFramework();

            PrintBuildType();

            PrintBambooInfo();

            DemoClass dc = new DemoClass();

            dc.Name = "Demo Class";
            string   json = JsonConvert.SerializeObject(dc);
            Assembly jc   = typeof(JsonConvert).Assembly;

            Console.WriteLine("Newtonsoft.Json:           " + jc.FullName);

            int val = dc.StringToInt("1234");

            Stack s = new Stack();

            s.Push("Four");
            s.Push(3);
            s.Push("Two");
            s.Push(1);
            Console.WriteLine("Stack Pop:                 " + s.Pop());
            Console.WriteLine("Stack Pop:                 " + s.Pop());
            Console.WriteLine("Stack Pop:                 " + s.Pop());
            Console.WriteLine("Stack Pop:                 " + s.Pop());

            dc.YieldStatement();
#if NETCOREAPP3_1
            Console.WriteLine("Features only allowed in C# 8.0 (NETCoreApp3.0) or higher");
            Console.WriteLine(dc.GetNameGreeting("Michael", "Jonathan", "Holtz"));
            Console.WriteLine(dc.GetNameGreeting("Michael", null, "Holtz"));
            Console.WriteLine(dc.GetNameGreeting("Michael", "Jonathan", null));
            Console.WriteLine(dc.GetNameGreeting("Michael", null, null));
            Console.WriteLine(dc.GetNameGreeting(null, "Jonathan", "Holtz"));
            Console.WriteLine(dc.GetNameGreeting(null, null, "Holtz"));
            Console.WriteLine(dc.GetNameGreeting(null, "Jonathan", null));
            Console.WriteLine(dc.GetNameGreeting(null, null, null));
#endif
            Console.WriteLine(""); //Blank Line
            //Keep the console open to be able to see what it says if not run from a Command Window
            Console.WriteLine("Press Any Key to continue");
            Console.ReadLine();
        }