I'd like to use this code to update info in my indicator. It looks perfect but there are at least a couple things I don't understand.
in this section of code,
public class SetIndicatorValueFromAddonWindowExample : Indicator
{
#region Variables
private string message;
private System.Windows.Controls.Grid myGrid;
private System.Windows.Controls.Button openWindowButton;
private AddOns.SetIndicatorValueFromAddonWindowExampleToolsWindow setIndicatorValueFromAddonWindowExampleToolsWindow;
#endregion
the AddOn uses the name of the indicator with "ToolsWindow" appended to the end of the indicator name. I tried to make a copy of the indicator, called Bob, I get an error that says I can't convert Bob to SetIndicatorValueFromAddonWindowExample. Which I think I understand. So I changed every occurrence of "SetIndicatorValueFromAddonWindowExample" with "Bob". That didn't work.
So how do I add this code to my existing indicator, which isn't called "SetIndicatorValueFromAddonWindowExample".
2nd thing I don't understand.
there is this method that displays the info on screen
public void ShowValues()
{
message = string.Format( "Instrument: {0} | Integer: {1} | String: {2}", ((InstrumentValue != null) ? InstrumentValue.FullName : "null"), IntValue, StringValue );
Draw.TextFixed(this, "valuesBox", message, TextPosition.Center, ChartControl.Properties.ChartText, new SimpleFont("Arial", 20), Brushes.Black, ChartControl.Properties.ChartBackground, 100);
ForceRefresh();
My plan is to use the code to update items in a list. I will select a drawing object on the screen. When I click the "Open Window" button I will loop thru the Drawing Objects collection to find the one that has state = editing. I will populate the fields from the drawing object attributes and change whatever ones need to be updated. Then save them back to the list that creates the drawing object.
But I'm not sure where to do that since the ShowValues method doesn't appeared to be called anywhere, but is shows up and stays after you first click the button.
As simple as the code looks, I can't get my head around those 2 concepts to be able to add them to my code. Any clarification is appreciated

Comment