private bool SetBarSeriesStyle(BSStyle barSeriesStyle, bool force)
{
bool flag = true;
if (barSeriesStyle == BSStyle.Candle || barSeriesStyle == BSStyle.Bar || barSeriesStyle == BSStyle.Line)
{
if (!(this.mainSeriesView is SimpleBSView) || force)
{
this.pads[0].RemovePrimitive(this.mainSeriesView);
this.mainSeriesView = new SimpleBSView(this.pads[0], this.series as BarSeries);
(this.mainSeriesView as SimpleBSView).UpColor = this.candleUpColor;
(this.mainSeriesView as SimpleBSView).DownColor = this.candleDownColor;
this.mainSeries = this.mainSeriesView.MainSeries;
this.pads[0].AddPrimitive(this.mainSeriesView);
}
else
flag = false;
if (barSeriesStyle == BSStyle.Candle)
(this.mainSeriesView as SimpleBSView).Style = SimpleBSStyle.Candle;
if (barSeriesStyle == BSStyle.Bar)
(this.mainSeriesView as SimpleBSView).Style = SimpleBSStyle.Bar;
if (barSeriesStyle == BSStyle.Line)
(this.mainSeriesView as SimpleBSView).Style = SimpleBSStyle.Line;
}
return flag;
}