 <pre><code>class A_Class { Ref&lt;string&gt; link; void A_Class( Ref&lt;string&gt; link) { this.link= link; } void somefunction( string str ) { if(link.Value.Length &gt; 2) link.Value = str; } } public class Ref&lt;T&gt; { private Func&lt;T&gt; getter; private Action&lt;T&gt; setter; public Ref(Func&lt;T&gt; getter, Action&lt;T&gt; setter) { this.getter = getter; this.setter = setter; } public T Value { get { return getter(); } set { setter(value); } } } </code></pre>