Simplest C# code to poll a property?

后端 未结 8 1966
慢半拍i
慢半拍i 2021-01-03 06:31

I would like to know the simplest code for polling a property\'s value, to execute the code in its getter.
Currently I\'m using: instance.property.ToString();

8条回答
  •  醉话见心
    2021-01-03 07:31

    I would extract the code in the getter to a function and call the function both, from the getter and from your poller, if this is an option for you.

提交回复
热议问题