C# Is Type in list question

Basic c# question. In the sample bellow But the 'is' doesn't like the type variable. Any ideas there should be a simple answer.

    List<object> list = new List<object>();
    list.Add("one");
    list.Add(2);
    list.Add('3');

    Type desiredType = typeof(System.Int32);

    if (list.Any(w => w is desiredType))
    {
        //do something
    }
5
задан Ryan Mrachek 27 April 2011 в 11:57
поделиться