Execution of code just once in c#
<p>I wish to know if there is a maner to execute code in c# just once, like one in jquery:</p>

<p>$("#foo").one("click", function() {
  alert("This will be displayed only once.");
});</p>

<p>what i would like to do is the follow:</p>

<pre><code>public void foo(){
  Console.Write("hello");
}
</code></pre>

<p>then</p>

<pre><code>foo();
foo();
foo();
</code></pre>

<p>and the output result must be</p>

<pre><code>hello
</code></pre>

<p>I´m looking for a library and not just using flags attributes.</p>

<p>Thanks in advance.</p>

<p>Sorry for my english.</p>
