How to make use of reference to a variable in c#
<p>I would like to shorten the expression like </p>

<pre><code>this.GdkWindow.GetPosition(ConfigurationService.ApplicationSettings.rect1.X,
                           ConfigurationService.ApplicationSettings.rect1.Y);
</code></pre>

<p>to something like <code>this.GdkWindow.GetPosition(refRect1.X, refRect1.Y)</code> using reference to a <code>ConfigurationService.ApplicationSettings.rect1</code> variable.</p>

<p>In C++ I am able to make use of a reference to the object (or variable) like this:</p>

<pre><code>Rect&amp; refRect1 = very.very2.very3.long_variable.rect1;
GetPosition(refRect1.x, refRect1.y);
</code></pre>

<p>How can I make the same in C#?</p>

<p>And how can I make a reference to the <code>int</code> variable like the following C++ code does:</p>

<pre><code>int A = 5;
int&amp; B = A;
B = 12;
</code></pre>

<p><strong>Update:</strong> The <code>GetPosition</code> method is declared as <code>void GetPosition(out int x, out int y)</code>. That method fills the <code>ConfigurationService.ApplicationSettings.rect1</code> struct with some data. That's why i would like to use a reference.</p>

<p>I know I can do something like:</p>

<pre><code>    var rect = new Gdk.Rectangle();
    this.GdkWindow.GetPosition(out rect.X, out rect.Y);
    this.GdkWindow.GetSize(out rect.Width, out rect.Height);
    ConfigurationService.ApplicationSettings.rect1 = rect;
</code></pre>

<p>but is there a way to avoid using the temporary variable? Is C# missing a feature even PHP has? Absolutely disappointed in C#!</p>
