void ReleaseDesignerOutlets()
        {
            if (NumberEight != null)
            {
                NumberEight.Dispose();
                NumberEight = null;
            }

            if (NumberFive != null)
            {
                NumberFive.Dispose();
                NumberFive = null;
            }

            if (NumberFour != null)
            {
                NumberFour.Dispose();
                NumberFour = null;
            }

            if (NumberNine != null)
            {
                NumberNine.Dispose();
                NumberNine = null;
            }

            if (NumberOne != null)
            {
                NumberOne.Dispose();
                NumberOne = null;
            }

            if (NumberSeven != null)
            {
                NumberSeven.Dispose();
                NumberSeven = null;
            }

            if (NumberSix != null)
            {
                NumberSix.Dispose();
                NumberSix = null;
            }

            if (NumberThree != null)
            {
                NumberThree.Dispose();
                NumberThree = null;
            }

            if (NumberTwo != null)
            {
                NumberTwo.Dispose();
                NumberTwo = null;
            }

            if (NumberZero != null)
            {
                NumberZero.Dispose();
                NumberZero = null;
            }

            if (ResultText != null)
            {
                ResultText.Dispose();
                ResultText = null;
            }
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");
            //01.md
            NumberOne.myName();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //02.md
            NumberTwo.birthday();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //03.md
            NumberThree.countString();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //04.md
            string[] censoredWords = { "imperdiet", "dolor", "duo" };
            var      paragraph     = "Lorem ipsum dolor sit amet, imperdiet vituperata duo in, nonumy.";

            NumberFour.Censor(censoredWords, paragraph);
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //05.md
            NumberFive.isEven();
            NumberFive.isOdd();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //06.md
            NumberSix.grade();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //07.md
            NumberSeven.celciusToFahrenheit(0);
            NumberSeven.fahrenheitToCelcius(50);
            NumberSeven.celciusToKelvin(100);
            NumberSeven.kelvinToCelcius(375);
            NumberSeven.kelvinToFahrenheit(375);
            NumberSeven.fahrenheitToKelvin(12);
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //08.md
            NumberEight.isLeapYear();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //09.md
            var jakarta = Tuple.Create("Jakarta", 7);
            var bali    = Tuple.Create("Bali", 8);
            var london  = Tuple.Create("London", 0);
            var cairo   = Tuple.Create("Cairo", 2);
            var denver  = Tuple.Create("Denver", -6);
            var chicago = Tuple.Create("Chicago", -5);

            NumberNine.timeZoneDiff(jakarta, london);
            NumberNine.timeZoneDiff(cairo, chicago);
            NumberNine.timeZoneDiff(cairo, bali);
            NumberNine.timeZoneDiff(denver, jakarta);
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //10.md
            NumberTen.Sum(1, 6);
            NumberTen.Multiply(2, 6);
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //11.md
            NumberEleven.sumArray();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //12.md
            NumberTwelve.upperCase("hello world");
            NumberTwelve.upperCase("welcome to the world");
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //13.md
            NumberThirteen.countWords("Hello");
            NumberThirteen.countWords("Hello World");
            NumberThirteen.countWords("Lorem ipsum dolor sit amet");
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //14.md
            NumberFourteen.isPalindrome("ipsum");
            NumberFourteen.isPalindrome("malam");
            NumberFourteen.isPalindrome("tidur");
            NumberFourteen.isPalindrome("kasur rusak");
            NumberFourteen.isPalindrome("ibu ratna antar ubi");
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //15.md
            NumberFifteen.Mirror("--vv");
            NumberFifteen.Mirror("..ww");
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //16.md
            string[] fruits =
            {
                "Jeruk",
                "Apel",
                "Anggur",
                "Pepaya",
                "Pisang",
                "Kiwi",
                "Markisa",
            };
            NumberSixteen.indexFinder(fruits, "Jeruk");
            NumberSixteen.indexFinder(fruits, "Pepaya");
            NumberSixteen.indexFinder(fruits, "Markisa");
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //17.md
            NumberSeventeen.Loop();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //18.md
            NumberEighteen.findMax();
            NumberEighteen.findMin();
            NumberEighteen.findAverage();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //19.md
            NumberNineteen.Sort();
            Console.WriteLine("-------------------------");
            Console.WriteLine();
            //20.md
            NumberTwenty item = new NumberTwenty();

            item.name   = "Indomie Goreng";
            item.price  = 3500;
            item.onSale = true;
            Console.WriteLine(item.print());
        }