How can I make some lines of code to run only one time
<p>Two classes in the same assembly: <code>Class A</code> and <code>Static</code> <code>Class B</code></p>

<p>In a method of <code>ClassA</code>, I am calling a method in <code>ClassB</code>,... but I want that to be called only one time and not every single time that I am caling that method of <code>ClassA</code> ...
currently I am setting a global property -Ran - to see if that method has been ran before or not...well it works but I feel that this is not the best design. I was wondering if there are better ways to do the same?</p>

<p>Thanks.</p>

<pre><code>ClassA.MyMethod(...)
{
....
//.... 
if (ClassB.Ran != 1)
    ClassB.Foo();
....
//...
}
</code></pre>
