Re:Porting 4.5K lines of C to Go
by taspeotis on Saturday August 05, 2017 @09:26AM
(#14935554)
There's no direct equivalent to willSet or didSet. The closest equivalent (aside from adding code before/after your own get/set code) might be INotifyPropertyChanged [1]/INotifyPropertyChanging [2]? But they are more for external observers and add a lot of boilerplate to your code. It's possible to manage the boilerplate, however [3].
[1] https://msdn.microsoft.com/en-us/library/system.componentmod...
[2] https://msdn.microsoft.com/en-us/library/system.componentmod...
[3] https://github.com/Fody/PropertyChanged