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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:27:06+00:00 2026-05-21T02:27:06+00:00

He everybody, I’m trying to setup a project management class. In order to see

  • 0

He everybody,

I’m trying to setup a project management class.
In order to see if somthing in the data changed i want to implement events on the lower level of the programming structure. I have some Classes extending the ProjectComponent Class. The base class has an event and event throwing methode, which the childcomponents can use.
Now I have a couple of custom list (nameley eList) in the project object.
Because all the child component have a common parent, ProjectComponent, i would like my custom list object (eList) to subscribe to the event when an object is added and unsubscribe when removed.

However when trying to prog this, i received the following error:

‘ProjectComponent’ does not contain a
definition for ‘itemChanged’ and no
extension method ‘itemChanged’
accepting a first argument of type
‘ProjectComponent’

Which is kind of wierd seeing as the class clearly has that public field.

Here is a the code:

public class ProjectComponent
{
    public event ItemChanged itemChanged;

    public void throwItemChangedEvent(ItemChangedEventArgs Arguments)
    {
        if (itemChanged != null)
            itemChanged(new Object(), Arguments);
    }
}

public class eList<ProjectComponent> : IList<ProjectComponent>
{
    List<ProjectComponent> internalList = new List<ProjectComponent>();
    public override void Add(ProjectComponent Item)
    {
        this.internalList.Add(Item);
        Item.itemChanged += new ItemChanged(ItemChanged_Handler);
    }

    private void ItemChanged_Handler(object sender, ItemChangedEventArgs eventArgs)
    {
        //do stuff here
    }
}

An example how it would be called is:

public eList<ChildClass> Children = new eList<ChildClass>();

The idea is that when an object in the list is edited the list object recieve an object like so:

Children.childstring = "anything";

At the moment the field inside the Children object is changed an event could be recieved.

My question is simply what am i doing wrong, why cant i suscribe to the ProjectComponent event inside the eList class?
Or does anyone know a better way to achive the same results?

Thanks in Advance,

Harry

Edit: Definition of ItemChanged delagate:

public delegate void ItemChanged(object sender, ItemChangedEventArgs eventArgs);
public class ItemChangedEventArgs : EventArgs
{
    private String p_CallStack;

    public String CallStack
    {
        get { return this.p_CallStack; }
        set { this.p_CallStack = value; }
    }

    public ItemChangedEventArgs()
    {
        p_CallStack = "";
    }

    public ItemChangedEventArgs(String StackStart)
    {
        p_CallStack = StackStart;
    }
}
  • 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-21T02:27:06+00:00Added an answer on May 21, 2026 at 2:27 am

    you have 2 errors:

    1.

    in generic class definition you must use variables not existing classes:

    public class eList<ProjectComponent>: ...

    –> public class eList<T>: ...

    in your case you want to do:

    public class eList : IList<ProjectComponent>
    

    2.

    Item.itemChanged += new Item.itemChanged(ItemChanged_Handler);
    

    new Item.itemChanged has no meaning, you have to use the underlying delegate type of your event:

    Item.itemChanged += new ItemChanged(ItemChanged_Handler);
    

    N.B:

    your code does not respect at all design guidelines for c#

    More informations here:Naming Guidelines

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

Sidebar

Related Questions

Heyy Everybody! I am trying to create a memory management system, so that a
everybody! I'm trying to digitally sign some data in C#. Everything goes without error
everybody, I'm beginner in programming, I've just finished my course on C++, I want
Hy everybody! I'm trying to use Childbrowser Phonegap plugin to redirect the user within
Hi everybody i'm stuck with trying to convert my UIWebView, in which i'm currently
Hi everybody I have a code that give me this error Fatal error: Class
everybody. I want to understand, how i shoud procceed situations when an asynchronous method
Everybody, I am a Python/C# guy and I am trying to learn C++. In
EveryBody.. i want to create one 8*8 dimensional array in objective c.. ( [0,
everybody, I am getting started develop a C++ project and in this project I

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.