Sorting a collection of objects based on an array of strings
<p>This seems to be simple enough, but I'm having a hard time getting free of the mental block on this one.</p>

<p>I've got a list of names and the items are ordered specifically based on some business rule. This is the order that is considered correct for some given situation.</p>

<p>So </p>

<pre><code>string [] original = {"Bob","Jim","Kat","Nat","Kim","Ant"};
</code></pre>

<p>I've got a Person type that contains a field Name, which will have one of the above values.</p>

<p>So, </p>

<pre><code>class Person {
    ...
    public  string Name; //Name will be one of the above values.
    ...
}
</code></pre>

<p>and I've got a bunch of these person objects, in a collection.</p>

<pre><code>PersonCollection p = new PersonCollection 
                     { new Person{ .. Name = "Kat"..}, 
                       new Person {.. "Kim" ..} ...
                     } etc.;
</code></pre>

<p>I know that all of these objects will  have names that only contain the values from the above list, there aren't even going to be duplicates. I need to arrange this collection of persons, by the order of the names supplied in the master list (i.e the "original" array above).</p>

<p>Straightforward so far, but here is the tricky bit.</p>

<p>By virtue of the way the Person Class is defined, and I cannot go in and change this, unfortunately, we only have the following available methods in the person object that </p>

<p>move the items.</p>

<pre><code>MoveToFirst(PersonCollection collection) // Move to the first of the given collection
MoveToLast(PersonCollection collection) // Move to the last of the given collection
MoveAfter(PersonCollection collection, Person previousPerson) //places the object after another person item, which is present in the list.
</code></pre>

<p>Anyone? By the way, as you can probably tell, this is a "hypothetical" representaion of a problem, I cannot post or discuss the actual production code here, unfortunately. I hope someone else has encountered something similar before.</p>
