Skip to content

Instantly share code, notes, and snippets.

@sherpc
Created May 14, 2012 20:27
Show Gist options
  • Save sherpc/2696545 to your computer and use it in GitHub Desktop.
Save sherpc/2696545 to your computer and use it in GitHub Desktop.
RefTest
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