Skip to content

Commit c4dcee4

Browse files
committed
Charting. Envelope indicator rendering fix.
Charting. Painters lookup refactoring.
1 parent 5fdcfa3 commit c4dcee4

File tree

5 files changed

+322
-238
lines changed

5 files changed

+322
-238
lines changed

Configuration/Extensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,13 @@ public static IEnumerable<IndicatorType> GetIndicatorTypes()
248248

249249
var rendererTypes = typeof(Chart).Assembly
250250
.GetTypes()
251-
.Where(t => !t.IsAbstract && typeof(BaseChartIndicatorPainter).IsAssignableFrom(t))
252-
.ToDictionary(t => t.Name);
251+
.Where(t => !t.IsAbstract && typeof(BaseChartIndicatorPainter).IsAssignableFrom(t) && t.GetAttribute<IndicatorAttribute>() != null)
252+
.ToDictionary(t => t.GetAttribute<IndicatorAttribute>().Type);
253253

254254
_indicatorTypes = typeof(IIndicator).Assembly
255255
.GetTypes()
256256
.Where(t => t.Namespace == ns && !t.IsAbstract && typeof(IIndicator).IsAssignableFrom(t) && t.GetConstructor(Type.EmptyTypes) != null && t.GetAttribute<BrowsableAttribute>()?.Browsable != false)
257-
.Select(t => new IndicatorType(t, rendererTypes.TryGetValue(t.Name + "Painter")))
257+
.Select(t => new IndicatorType(t, rendererTypes.TryGetValue(t)))
258258
.Concat(_customIndicators)
259259
.OrderBy(t => t.Name)
260260
.ToArray();

0 commit comments

Comments
 (0)