Like enum but for objects
<p>I have a custom class "Error" and some pre-created errors (let's call them A, B and C). Now I'd love to group these pre-created ones under one group (for example, "StockErrors") and use them kind of like an enum:</p>

<pre><code>private void SomeFunction(Error NewError)
{
    if (NewError == StockErrors.A) DoSomething(); // this is what I need.
}
</code></pre>

<p>Any ideas how I could accomplish this? It's probably something extremely simple...</p>

<p>Thanks in advance!</p>
