private bool SetBSView(BSStyle style, bool obj1) { bool flag = true; if (style == BSStyle.Candle || style == BSStyle.Bar || style == BSStyle.Line) { if (!(this.mainSeriesView is SimpleBSView) || obj1) { this.pads[0].RemovePrimitive((IChartDrawable)this.mainSeriesView); this.mainSeriesView = (SeriesView)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 (style == BSStyle.Candle) (this.mainSeriesView as SimpleBSView).Style = SimpleBSStyle.Candle; if (style == BSStyle.Bar) (this.mainSeriesView as SimpleBSView).Style = SimpleBSStyle.Bar; if (style == BSStyle.Line) (this.mainSeriesView as SimpleBSView).Style = SimpleBSStyle.Line; } else if (style == BSStyle.Kagi) { if (!(this.mainSeriesView is KagiBaView) || obj1) { this.pads[0].RemovePrimitive((IChartDrawable)this.mainSeriesView); this.mainSeriesView = (SeriesView)new KagiBaView(this.pads[0], this.series as BarSeries); this.mainSeries = this.mainSeriesView.MainSeries; this.pads[0].AddPrimitive((IChartDrawable)this.mainSeriesView); } } else if (style == BSStyle.LineBreak) { if (!(this.mainSeriesView is LineBreakBSView) || obj1) { this.pads[0].RemovePrimitive((IChartDrawable)this.mainSeriesView); this.mainSeriesView = (SeriesView)new LineBreakBSView(this.pads[0], this.series as BarSeries); this.mainSeries = this.mainSeriesView.MainSeries; this.pads[0].AddPrimitive((IChartDrawable)this.mainSeriesView); } } else if (style == BSStyle.Ranko) { if (!(this.mainSeriesView is RankoBSView) || obj1) { this.pads[0].RemovePrimitive((IChartDrawable)this.mainSeriesView); this.mainSeriesView = (SeriesView)new RankoBSView(this.pads[0], this.series as BarSeries); this.mainSeries = this.mainSeriesView.MainSeries; this.pads[0].AddPrimitive((IChartDrawable)this.mainSeriesView); } } else if (style == BSStyle.PointAndFigure && (!(this.mainSeriesView is PnFBSView) || obj1)) { this.pads[0].RemovePrimitive((IChartDrawable)this.mainSeriesView); this.mainSeriesView = (SeriesView)this.AaUga350I(this.pads[0], this.series as BarSeries); this.mainSeries = this.mainSeriesView.MainSeries; this.pads[0].AddPrimitive((IChartDrawable)this.mainSeriesView); } return flag; }
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; }