.NET Type Conversion Issue: Simple but difficult
Posted
by jaderanderson
on Stack Overflow
See other posts from Stack Overflow
or by jaderanderson
Published on 2010-03-30T17:34:25Z
Indexed on
2010/03/30
17:43 UTC
Read the original article
Hit count: 502
Well,
the question is kinda simple.
I have a object defined as:
public class FullListObject : System.Collections.ArrayList, IPagedCollection
And when i try to:
IPagedCollection pagedCollection = (IPagedCollection)value;
It don't work... value is a FullListObject... this is my new code trying to get around a issue with the "is" operator. When the system tests (value is IPagedCollection)
it never gets true for FullListObject.
How to cast the object to another object with a interface type?
© Stack Overflow or respective owner