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 6152925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:00:19+00:00 2026-05-23T20:00:19+00:00

I have an interface called IEditor public interface IEditor<T> where T: SpecialObject SpecialObject is

  • 0

I have an interface called IEditor

public interface IEditor<T> 
    where T: SpecialObject

SpecialObject is an abstract class.

Here´s my problem:

I have a class which inherits from SpecialObject and a view which implements this IEditor interface

public class View : IEditor<Person>

Now, I have to check whether View implements IEditor<SpecialObject>

Boolean isEditor = View is IEditor<SpecialObject>

But IEditor is always false

Is there any possibility to check if View is IEditor<SpecialObject>?

Edit

I have a method which is called when a closing event is raised.
The views which are passed to this method can implement IEditor, but they also can implement another interface. In example IView

  void Closing(object sender, MyEventArgs e)
  {
      if(e.Item is IView)
      {
          // DO some closing tasks

          if(e.Item is IEditor<SpecialObject>)          // always false
          {
              // Do some special tasks
              var editor = e.Item as IEditor<SpecialObject>;

              var storedEditObect = editor.StoredObject;

              // more tasks
          }
      } else if(e.Item is ISomeOtherView)
      {}
  }

I have some classes called Person, Address and so on. They all inherits from SpecialObject.
In some case e.Item inherits from IEditor or from IEditor
Because of that, I have to cast to my base class to access the defaut property fields

  • 1 1 Answer
  • 0 Views
  • 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-23T20:00:20+00:00Added an answer on May 23, 2026 at 8:00 pm

    Create a non-generic base interface. Eg:

    public interface IEditor {}
    
    public interface IEditor<T> : IEditor ... {}
    

    Then check for IEditor.

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

Sidebar

Related Questions

So here's what I have: 1 interface called Set 1 abstract class which implements
I have an interface called ICommand from which various classes inherit. These classes all
I have an interface called Dictionary which has a method insert() . This interface
I'm having a small problem in Java. I have an interface called Modifiable. Objects
I have a basic core interface called IComponent. public interface IComponent { void Initialize();
I have a package-private interface called AbstractServer which offers three methods: start() , stop()
I have a C# interface, and a concrete class that implements that interface. I
I have made an interface called IHero i implement in my hero.as3 class. the
I have an interface called IAddress, and a class called Address that handles street,
I have an interface called iIncident which defines a single method when() . when()

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.