see if this alternate can help..
class Program
{
public class User
{
public string Name;
public int Age;
public User(string name, int age)
{
this.Name = name;
this.Age = age;
}
}
static void Main(string[] args)
{
User[] users = new User[3] { new User("Betty", 23),
new User("Susan", 20),
new User("Lisa", 25) };
int customVariable = 10;
Array.Sort(users, delegate(User user1, User user2)
{
int theCustomVariable = customVariable;
return user1.Age.CompareTo(user2.Age);
});
foreach (User user in users) Console.Write(user.Name + user.Age + " ");
}
}
i'll for exact solution meanwhile :)
Thanks,
Hemant