WealthScript Inheritance
Author: Ben_Zurich
Creation Date: 3/21/2012 11:55 AM
profile picture

Ben_Zurich

#1
In an attempt to setup Visual Studio for WL6 I wanted to structure my core programs in separate classes whose methods could be accessed within the Execute() method. A "core program" could be for instance the painting of vertical zigzag (peak/trough of the base) lines througout all panes. I want to have such core programs in separate classes.

In order to do this I first wanted to have those separate classes in the native WL6 C# editor (all in the same file). Naturally, I want to have access to DataSeries as well as to graphics within those core programs. Therefore I had to inherit the WealthScript class. And this is where the problems started. First of all, I am obliged to have a Execute() method even though the core program is no strategy but serves an entirely different purpose. Second, after having coded a dummy Execute() method within my core class that inherits WealthScript, I was not able to pass parameters to the core method. I get the error that the parameters are nor instances of an object.

I hope you understand my goal. How can I do this?
profile picture

Eugene

#2
Check this out - to pass WealthScript object by reference:

Example 1:
CODE:
Please log in to see this code.


Example 2 by Aleksey:
CODE:
Please log in to see this code.


Also, Community Components source code, lost of illustrations of the technique above

Hope this helps.
profile picture

Ben_Zurich

#3
Yep. Thanks a lot!
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).