Click here to Skip to main content
16,004,828 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help decoding base_64+GZipped string. [modified] Pin
Guffa5-Dec-08 14:09
Guffa5-Dec-08 14:09 
GeneralRe: Help decoding base_64+GZipped string. Pin
Zeokat5-Dec-08 15:51
Zeokat5-Dec-08 15:51 
GeneralRe: Help decoding base_64+GZipped string. Pin
Zeokat6-Dec-08 4:37
Zeokat6-Dec-08 4:37 
QuestionGet the frequency of a audio-sound Pin
softwarejaeger5-Dec-08 7:33
softwarejaeger5-Dec-08 7:33 
QuestionSqlBulkCopy question Pin
Jon Stroh5-Dec-08 7:19
Jon Stroh5-Dec-08 7:19 
AnswerRe: SqlBulkCopy question Pin
Wendelius5-Dec-08 8:37
mentorWendelius5-Dec-08 8:37 
Questionobject type [modified] Pin
nlowdon5-Dec-08 6:40
nlowdon5-Dec-08 6:40 
AnswerRe: object type Pin
Thomas Weller5-Dec-08 7:05
Thomas Weller5-Dec-08 7:05 
You can use one of the following methods to do that:

if (pettable.GetType() == typeof(myType))
{
    ...
}

if (pettable.GetType().Name == "myType")
{
    ...
}

if (pettable is myType)
{
    ...
}


But you probably shouldn't do it that way.
When you are looking for a certain method to call, you should always do so by using an interface. Avoid looking for a concrete type in your code wherever possible. This is bad coding style!

It is a far better solution to create another interface for each method you want to know about, exactly like you did it with the pet() method. This is one of the main purposes of the syntactical construct interface: They mark a type to have a certain member (i.e. method/property/event).

Regards
Thomas

www.thomas-weller.de

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software.


GeneralRe: object type Pin
nlowdon5-Dec-08 8:30
nlowdon5-Dec-08 8:30 
GeneralRe: object type Pin
Thomas Weller6-Dec-08 2:17
Thomas Weller6-Dec-08 2:17 
AnswerRe: object type Pin
Le centriste5-Dec-08 7:07
Le centriste5-Dec-08 7:07 
Questionstatus bar value in iexplorer Pin
kralece5-Dec-08 6:13
kralece5-Dec-08 6:13 
AnswerRe: status bar value in iexplorer Pin
Thomas Stockwell5-Dec-08 7:10
professionalThomas Stockwell5-Dec-08 7:10 
GeneralRe: status bar value in iexplorer Pin
kralece5-Dec-08 7:38
kralece5-Dec-08 7:38 
GeneralRe: status bar value in iexplorer Pin
Thomas Stockwell5-Dec-08 8:40
professionalThomas Stockwell5-Dec-08 8:40 
AnswerRe: status bar value in iexplorer Pin
Dave Kreskowiak5-Dec-08 7:53
mveDave Kreskowiak5-Dec-08 7:53 
GeneralRe: status bar value in iexplorer Pin
kralece5-Dec-08 15:03
kralece5-Dec-08 15:03 
GeneralRe: status bar value in iexplorer Pin
kralece7-Dec-08 7:51
kralece7-Dec-08 7:51 
GeneralRe: status bar value in iexplorer Pin
Dave Kreskowiak7-Dec-08 12:05
mveDave Kreskowiak7-Dec-08 12:05 
GeneralRe: status bar value in iexplorer Pin
kralece8-Dec-08 14:26
kralece8-Dec-08 14:26 
QuestionCreate a graf in Windows application Pin
Mc_Topaz5-Dec-08 6:00
Mc_Topaz5-Dec-08 6:00 
AnswerRe: Create a graf in Windows application Pin
Giorgi Dalakishvili5-Dec-08 6:39
mentorGiorgi Dalakishvili5-Dec-08 6:39 
QuestionRe: Create a graf in Windows application Pin
Mc_Topaz5-Dec-08 9:30
Mc_Topaz5-Dec-08 9:30 
AnswerRe: Create a graf in Windows application Pin
jsalinas1-Oct-09 10:27
jsalinas1-Oct-09 10:27 
QuestionDataRowVersion.Modified is true but Current and Original Values for All columns are equal Pin
polishprogrammer5-Dec-08 5:47
polishprogrammer5-Dec-08 5:47 

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.