I want to now who create instance of my class

For example at constructer I look who create me , and do something
according to caller application / class

Thanks

Recommended Answers

All 3 Replies

You typically just put a parent in the constructor:

public IOAnalog()
    {
    }
    public IOAnalog(Sensor Parent, IOAnalogType AnalogType)
      : this()
    {
      this._parent = Parent;
      this._IOType = AnalogType;
    }

Will this not work?

is "Sensor" caller class name for these condition ?

You typically just put a parent in the constructor:

public IOAnalog()
    {
    }
    public IOAnalog(Sensor Parent, IOAnalogType AnalogType)
      : this()
    {
      this._parent = Parent;
      this._IOType = AnalogType;
    }

Will this not work?

That is a class name

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.