Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

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);
    }

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.