Calling Execcontrol.Recalculate() from another class  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Sparrow
Posts: 3
Joined: 17 Jun 2013
Has thanked: 1 time

Calling Execcontrol.Recalculate() from another class

Postby Sparrow » 17 Jun 2013

Hi,

I am fairly new to C# and most of my issue stems from that fact. I have created a form that interacts with MultiCharts and lets me update indicators from the Form instead of from MultiCharts. I would like to implement an "Apply" button in my form that refreshes the MultiCharts window. This is normally accomplished, in my understanding, by using ExecControl.Recalculate().

My issue is that I can not seem to call Recalculate method from any other class other than the indicator class. I have tried using delegates to pass a reference to the method however in all my attempts I get an error message that says
Inaccessible Property or Method: ExecControl
Is what I am trying to do even possible and if so, what is the proper way to do it?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Calling Execcontrol.Recalculate() from another class

Postby Henry MultiСharts » 18 Jun 2013

Hello Sparrow,

That is possible. Here is an example how to do that.

Sparrow
Posts: 3
Joined: 17 Jun 2013
Has thanked: 1 time

Re: Calling Execcontrol.Recalculate() from another class

Postby Sparrow » 18 Jun 2013

Hi,

Thank you for the quick response. I looked through the example but I'm not sure how to apply it to what I need. Can you please explain?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Calling Execcontrol.Recalculate() from another class  [SOLVED]

Postby Henry MultiСharts » 19 Jun 2013

You need to transfer the link for the MultiCharts object from the base class into a different external class to achieve your goal. The example above shows how to do that with IDataLoader interface.

Sparrow
Posts: 3
Joined: 17 Jun 2013
Has thanked: 1 time

Re: Calling Execcontrol.Recalculate() from another class

Postby Sparrow » 19 Jun 2013

Figured it out! Thanks for pointing me in the right direction!


Return to “MultiCharts .NET”