コード例 #1
0
ファイル: Program.cs プロジェクト: ErhanGDC/MyWorks
        static void Main(string[] args)
        {
            //Conversions
            Money   m               = new Money(42.42M);
            decimal amount          = m;
            int     truncatedAmount = (int)m;



            Calculator ca = new Calculator();

            Console.WriteLine(ca.CalculateDiscount(new Prodcut()
            {
                Price = 10
            }));
            Console.WriteLine(string.Concat("To box or not box", 42, true));

            Console.WriteLine("-----------------------------------");

            Celal cel = new Celal()
            {
                Yas = 35
            };

            Console.WriteLine(cel.Yas);

            Console.WriteLine(YasDegis(cel));

            Console.WriteLine(cel.Yas);
            Console.Read();

            Object       stream       = new MemoryStream();
            MemoryStream memoryStream = (MemoryStream)stream;
            double       x            = 1234.7;
            int          a;

            // Cast double to int
            a = (int)x; // a = 1234
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ErhanGDC/MyWorks
 public static int YasDegis(Celal par)
 {
     return(par.Yas = 30);
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: ErhanGDC/MyWorks
        static void Main(string[] args)
        {
            //Conversions
            Money m = new Money(42.42M);
            decimal amount = m;
            int truncatedAmount = (int)m;

            Calculator ca = new Calculator();
            Console.WriteLine(ca.CalculateDiscount(new Prodcut() { Price = 10 }));
            Console.WriteLine(string.Concat("To box or not box", 42, true));

            Console.WriteLine("-----------------------------------");

            Celal cel = new Celal() { Yas = 35 };
            Console.WriteLine(cel.Yas);

            Console.WriteLine(YasDegis(cel));

            Console.WriteLine(cel.Yas);
            Console.Read();

            Object stream = new MemoryStream();
            MemoryStream memoryStream = (MemoryStream)stream;
            double x = 1234.7;
            int a;
            // Cast double to int
            a = (int)x; // a = 1234
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: ErhanGDC/MyWorks
 public static int YasDegis(Celal par)
 {
     return par.Yas = 30;
 }