patterncsharpCritical
Test if object implements interface
Viewed 0 times
interfaceobjecttestimplements
Problem
What is the simplest way of testing if an object implements a given interface in C#? (Answer to this question
in Java)
in Java)
Solution
if (object is IBlah)or
IBlah myTest = originalObject as IBlah
if (myTest != null)Code Snippets
if (object is IBlah)IBlah myTest = originalObject as IBlah
if (myTest != null)Context
Stack Overflow Q#410227, score: 688
Revisions (0)
No revisions yet.