Well here's a simple Move method which can do it, but there's gotta be a better way.
I don't recommend using something like this when there are a great many moves involved.
public static bool
Move
(
System.Collections.IList Array
,
int From
,
int To
)
{
bool result = false ;
switch ( From.CompareTo ( To ) )
{
case 1 :
{
object val = Array [ From ] ;
for ( int i = From ; i > To ; i-- )
{
Array [ i ] = Array [ i - 1 ] ;
}
Array [ To ] = val ;
result = true ;
break ;
}
case -1 :
{
object val = Array [ From ] ;
for ( int i = From ; i < To ; i++ )
{
Array [ i ] = Array [ i + 1 ] ;
}
Array [ To ] = val ;
result = true ;
break ;
}
}
return ( result ) ;
}