If all is Ok, I can set fields of the object and get the next output:
[8] TestObjectProperties VALUES NUM 2
[8] Set Settings2 Line_02 False True
[8] Set Settings1 Line_01 True False
[8] TestObjectProperties===========================
[8] TestObjectProperties========Settings===========
[8] TestObjectProperties===========================
[8] TestObjectProperties Line_01 True False
[8] TestObjectProperties Line_02 False True
[8] TestObjectProperties===========================
[8] TestObjectProperties
[8] TestObjectProperties===========================
But when I recompile the indicator and press F5 on the chart window I get the next
Failed to set property 'Settings2' for indicator 'TestObjectProperties': Object of type "My_Settings.LongsShortsSettings" cannot be converted to object of type "My_Settings.LongsShortsSettings".
Failed to set property 'Settings1' for indicator 'TestObjectProperties': call destination has created an exception.
Failed to set property 'Settings2' for indicator 'TestObjectProperties': call destination has created an exception.
[1] TestObjectProperties create outputs True
[1] TestObjectProperties VALUES NUM 2
[1] TestObjectProperties===========================
[1] TestObjectProperties========Settings===========
[1] TestObjectProperties===========================
[1] TestObjectProperties Line_01 False False
[1] TestObjectProperties Line_02 False False
[1] TestObjectProperties===========================
[1] TestObjectProperties
[1] TestObjectProperties===========================
I tried to use Reflection but it was unsuccessfull. This variant are commented in the code of indicator.
It is, in fact, the setter that is the problem.
The recommendation is to use
... which will prevent the Visual Designer from trying to assign a serialized version of ObjectX to your control at design time, which is really what was going on ...
But I had no result with it.
Also, I tried to use this indicator in the 3rd party software and I got the same error. As the result of it that software can't save previously set values by user.
What I should to to fix this error?
Comment