Line | |
---|
1 | using System.Collections;
|
---|
2 | using System.Windows;
|
---|
3 |
|
---|
4 | namespace Microsoft.Research.DynamicDataDisplay.DataSources
|
---|
5 | {
|
---|
6 | /// <summary>This enumerator enumerates given enumerable object as sequence of points</summary>
|
---|
7 | /// <typeparam name="T">Type parameter of source IEnumerable</typeparam>
|
---|
8 | public sealed class EnumerablePointEnumerator<T> : IPointEnumerator {
|
---|
9 | private readonly EnumerableDataSource<T> dataSource;
|
---|
10 | private readonly IEnumerator enumerator;
|
---|
11 |
|
---|
12 | public EnumerablePointEnumerator(EnumerableDataSource<T> dataSource) {
|
---|
13 | this.dataSource = dataSource;
|
---|
14 | enumerator = dataSource.Data.GetEnumerator();
|
---|
15 | }
|
---|
16 |
|
---|
17 | public bool MoveNext() {
|
---|
18 | return enumerator.MoveNext();
|
---|
19 | }
|
---|
20 |
|
---|
21 | public void GetCurrent(ref Point p) {
|
---|
22 | dataSource.FillPoint((T)enumerator.Current, ref p);
|
---|
23 | }
|
---|
24 |
|
---|
25 | public void ApplyMappings(DependencyObject target) {
|
---|
26 | dataSource.ApplyMappings(target, (T)enumerator.Current);
|
---|
27 | }
|
---|
28 |
|
---|
29 | public void Dispose() {
|
---|
30 | //enumerator.Reset();
|
---|
31 | }
|
---|
32 | }
|
---|
33 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.