Click here to Skip to main content
15,904,652 members
Home / Discussions / C#
   

C#

 
GeneralRe: HtmlAgilityPack Weirdness Pin
#realJSOP3-May-10 6:46
professional#realJSOP3-May-10 6:46 
GeneralRe: HtmlAgilityPack Weirdness Pin
Luc Pattyn3-May-10 6:57
sitebuilderLuc Pattyn3-May-10 6:57 
GeneralRe: HtmlAgilityPack Weirdness Pin
#realJSOP3-May-10 13:47
professional#realJSOP3-May-10 13:47 
GeneralRe: HtmlAgilityPack Weirdness Pin
Luc Pattyn3-May-10 13:59
sitebuilderLuc Pattyn3-May-10 13:59 
GeneralRe: HtmlAgilityPack Weirdness Pin
#realJSOP3-May-10 23:23
professional#realJSOP3-May-10 23:23 
GeneralRe: HtmlAgilityPack Weirdness [modified] Pin
#realJSOP4-May-10 0:09
professional#realJSOP4-May-10 0:09 
QuestionHow to license my product Pin
Jamal Abdul Nasir3-May-10 0:08
Jamal Abdul Nasir3-May-10 0:08 
AnswerRe: How to license my product Pin
Peace ON3-May-10 0:51
Peace ON3-May-10 0:51 
GeneralRe: How to license my product Pin
Jamal Abdul Nasir3-May-10 5:36
Jamal Abdul Nasir3-May-10 5:36 
GeneralRe: How to license my product Pin
Peace ON3-May-10 21:01
Peace ON3-May-10 21:01 
GeneralRe: How to license my product Pin
Johnny J.12-May-10 13:01
professionalJohnny J.12-May-10 13:01 
QuestionWebservice to receive SOAP/XML data Pin
sirTachyon3-May-10 0:01
sirTachyon3-May-10 0:01 
QuestionUsing cards.dll in Windows 7 Pin
Mc_Topaz2-May-10 23:21
Mc_Topaz2-May-10 23:21 
AnswerRe: Using cards.dll in Windows 7 Pin
Ghydo2-May-10 23:38
Ghydo2-May-10 23:38 
GeneralRe: Using cards.dll in Windows 7 Pin
Mc_Topaz2-May-10 23:59
Mc_Topaz2-May-10 23:59 
QuestionHi! is it possible that my dbase is sql2005 using php and javascript Pin
crisjala2-May-10 23:11
crisjala2-May-10 23:11 
AnswerRe: Hi! is it possible that my dbase is sql2005 using php and javascript Pin
Michel Godfroid2-May-10 23:48
Michel Godfroid2-May-10 23:48 
Questiontypeof() ???? Pin
reza assar2-May-10 23:09
reza assar2-May-10 23:09 
AnswerRe: typeof() ???? [modified] Pin
#realJSOP2-May-10 23:47
professional#realJSOP2-May-10 23:47 
GeneralRe: typeof() ???? Pin
reza assar4-May-10 23:26
reza assar4-May-10 23:26 
AnswerRe: typeof() ???? Pin
PIEBALDconsult3-May-10 4:34
mvePIEBALDconsult3-May-10 4:34 
GeneralRe: typeof() ???? Pin
reza assar4-May-10 23:31
reza assar4-May-10 23:31 
GeneralRe: typeof() ???? Pin
PIEBALDconsult5-May-10 4:13
mvePIEBALDconsult5-May-10 4:13 
Sure. Given a List<System.ValueType> (lis) containing values of different types, this will retrieve the first one that is of a specified type:

private static T
GetValue<T>
(
) where T : struct
{
    T result = default(T) ;

    foreach ( System.ValueType v in lis )
    {
        if ( v.GetType() == typeof(T) )
        {
            result = (T) v ;

            break ;
        }
    }

    return ( result ) ;
}

int i = GetValue<int>() ;


You can easily modify it to use Form rather than ValueType and make it more robust.
QuestionNew Project Ideas? Pin
CoderForEver2-May-10 19:56
CoderForEver2-May-10 19:56 
AnswerRe: New Project Ideas? Pin
Pete O'Hanlon2-May-10 20:42
mvePete O'Hanlon2-May-10 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.