Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 700521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:30:27+00:00 2026-05-14T03:30:27+00:00

Well, the question is kinda simple. I have a object defined as: public class

  • 0

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?

EDIT:

Just for the record: the bugger code

if (value is IPagedCollection)
{
    IPagedCollection pagedCollection = value as IPagedCollection;

The if was never hitting true, and forcing the conversion wasn’t working too. So the issue was the double definition of classes. Now i defined the FullObjectList in a “Commom” project for classes used by the whole system. Problem gone!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:30:27+00:00Added an answer on May 14, 2026 at 3:30 am

    You’re doing it right. Try this (it will fail also but show the problem):

    IPagedCollection pagedCollection = (FullListObject)value;
    

    The compiler should accept this just fine. If not, you have multiple definitions of either IPagedCollection and/or FullListObject which conflict each other. If that fails at runtime, your value is not a FullListObject.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well... simple question, right? But with no so simple answers. In firefox i use
Ok another WPF question, well I guess this is just general .NET. I have
Well the subject is the question basically. Are there any version control systems out
This question would probably apply equally as well to other languages with C-like multi-line
My question concerns c# and how to access Static members ... Well I don't
The question covers most of it, but I'm trying to present a well articulated
Here's one from the No question's too dumb department: Well, as the subject says:
this is my first question here so I hope I can articulate it well
The pages in question contain a lot of javascript and CSS. How well are
Question: Is exception handling in Java actually slow? Conventional wisdom, as well as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.