Is it possible to create an if statement that will encapsulate classes? I am trying two different indicators and give the choice to the users between one or the other.
For example:
If(indicator1)
{
public override void OnRenderTargetChanged()
{
textBrush = Brushes.Lime.ToDxBrush(RenderTarget);
}
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
if (IsInHitTest) return;
if (ChartBars != null)
{
//get the X and Y point of the cursor and convert them to pixels
int cursorPointX = ChartingExtensions.ConvertToHorizontalPixels(chart Control.MouseDownPoint.X, chartControl);
int cursorPointY = ChartingExtensions.ConvertToVerticalPixels(chartCo ntrol.MouseDownPoint.Y, chartControl);
blablabla
}
else(indicator2)
{
public override void OnRenderTargetChanged()
{
textBrush = Brushes.Red.ToDxBrush(RenderTarget);
}
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
if (IsInHitTest) return;
if (ChartBars != null)
{
//get the X and Y point of the cursor and convert them to pixels
int cursorPointX = ChartingExtensions.ConvertToHorizontalPixels(chart Control.MouseDownPoint.X, chartControl);
int cursorPointY = ChartingExtensions.ConvertToVerticalPixels(chartCo ntrol.MouseDownPoint.Y, chartControl);
blablabla
}

Comment