Tech Off Thread

2 posts

Accessing Self (C#)

Back to Forum: Tech Off
  • User profile image
    Khamul

    This seems incredibly basic. I have a class and I want it to pass itself in a method, to set itself as an owner of a subclass.

    How do you do this?

  • User profile image
    Khamul

    Ignore this. I found that I can use "this" in the constructor - I was trying to work out of methods, id est:

    public class Whatever
    {
       private CustomList<x> = new CustomList(this);
    }

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.