Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Collections.ObjectModel;
|
---|
4 | using System.ComponentModel;
|
---|
5 | using System.Windows;
|
---|
6 | using System.Windows.Media;
|
---|
7 |
|
---|
8 | namespace Microsoft.Research.DynamicDataDisplay.PointMarkers
|
---|
9 | {
|
---|
10 | /// <summary>Composite point markers renders a specified set of markers
|
---|
11 | /// at every point of graph</summary>
|
---|
12 | public sealed class CompositePointMarker : PointMarker {
|
---|
13 | public CompositePointMarker() { }
|
---|
14 |
|
---|
15 | public CompositePointMarker(params PointMarker[] markers) {
|
---|
16 | if (markers == null)
|
---|
17 | throw new ArgumentNullException("markers");
|
---|
18 |
|
---|
19 | foreach (PointMarker m in markers)
|
---|
20 | this.markers.Add(m);
|
---|
21 | }
|
---|
22 |
|
---|
23 | public CompositePointMarker(IEnumerable<PointMarker> markers) {
|
---|
24 | if (markers == null)
|
---|
25 | throw new ArgumentNullException("markers");
|
---|
26 | foreach (PointMarker m in markers)
|
---|
27 | this.markers.Add(m);
|
---|
28 | }
|
---|
29 |
|
---|
30 |
|
---|
31 | private readonly Collection<PointMarker> markers = new Collection<PointMarker>();
|
---|
32 | [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
---|
33 | public Collection<PointMarker> Markers {
|
---|
34 | get { return markers; }
|
---|
35 | }
|
---|
36 |
|
---|
37 | public override void Render(DrawingContext dc, Point screenPoint) {
|
---|
38 | LocalValueEnumerator enumerator = GetLocalValueEnumerator();
|
---|
39 | foreach (var marker in markers) {
|
---|
40 | enumerator.Reset();
|
---|
41 | while (enumerator.MoveNext()) {
|
---|
42 | marker.SetValue(enumerator.Current.Property, enumerator.Current.Value);
|
---|
43 | }
|
---|
44 |
|
---|
45 | marker.Render(dc, screenPoint);
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
49 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.