Created
May 14, 2012 20:27
-
-
Save sherpc/2696545 to your computer and use it in GitHub Desktop.
RefTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace RefTest | |
{ | |
class SomeClass | |
{ | |
public int SomeProperty { get; set; } | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var sc = new SomeClass(); | |
sc.SomeProperty = 1; | |
var oldValue = sc.SomeProperty; | |
ModifyProperty(sc); | |
Console.WriteLine("Property changed: {0}", oldValue != sc.SomeProperty); | |
} | |
static void ModifyProperty(SomeClass sc) | |
{ | |
sc.SomeProperty++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment