Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 6th, 2011  |  syntax: C#  |  size: 0.73 KB  |  hits: 145  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using System;
  2.  
  3. internal class Test
  4. {
  5.     private static int? a;
  6.  
  7.     private static int? A
  8.     {
  9.         get { Console.WriteLine("A Accessed"); return a; }
  10.         set { a = value; }
  11.     }
  12.  
  13.     private static int? b;
  14.  
  15.     private static int? B
  16.     {
  17.         get { Console.WriteLine("B Accessed"); return b; }
  18.         set { b = value; }
  19.     }
  20.  
  21.     private static int? c;
  22.  
  23.     private static int? C
  24.     {
  25.         get { Console.WriteLine("C Accessed"); return c; }
  26.         set { c = value; }
  27.     }
  28.  
  29.     //public int? testing { get; set; }
  30.  
  31.     private static void Main()
  32.     {
  33.         Console.WriteLine("First case");
  34.  
  35.         A = 4;
  36.         B = 4;
  37.         c = 4;
  38.  
  39.         int? something2 = (A ?? B) ?? C;
  40.     }
  41. }