public XX(XX obj) : this(obj.FInt, obj.FIntPrivate, obj.FIntProtected) { }
static void Main(string[] args) { #if TEST_SETTERS X x1 = new X(), x2 = new X(1, 1, 1), x3 = new X(x2); x1.FInt = 10; XX xx1 = new XX(), xx2 = new XX(100, 100, 100), xx3 = new XX(xx2); xx1.FInt *= 3; #endif B b1 = new B(), b2 = new B(123), b3 = new B() { FInt = 321 }; Console.WriteLine(b1.FInt); Console.WriteLine(b2.FInt); Console.WriteLine(b3.FInt); A a = new A(); if (a.FInt == 0) { Console.WriteLine("0"); } if (a.FLong == 0) { Console.WriteLine("0"); } if (a.FString == null) { Console.WriteLine("null"); } if (a.FString != null && a.FString == string.Empty) { Console.WriteLine("string.Empty"); } if (string.IsNullOrEmpty(a.FString)) { Console.WriteLine("string.IsNullOrEmpty"); } if (a.FDateTime == DateTime.MinValue) { Console.WriteLine("DateTime.MinValue"); } Console.WriteLine(a.Value); Console.WriteLine(a.Value); int i = a.FInt2 = 10; Console.WriteLine(i); }