Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/DataSources/OneDimensional/EmptyDataSource.cs @ 12503

Last change on this file since 12503 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6using System.Diagnostics.CodeAnalysis;
7
8namespace Microsoft.Research.DynamicDataDisplay.DataSources
9{
10  /// <summary>
11  /// Empty data source - for testing purposes, represents data source with 0 points inside.
12  /// </summary>
13  public class EmptyDataSource : IPointDataSource
14  {
15    #region IPointDataSource Members
16
17    public IPointEnumerator GetEnumerator(DependencyObject context)
18    {
19      return new EmptyPointEnumerator();
20    }
21
22    [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
23    private void RaiseDataChanged()
24    {
25      if (DataChanged != null)
26      {
27        DataChanged(this, EventArgs.Empty);
28      }
29    }
30
31    public event EventHandler DataChanged;
32
33    #endregion
34
35    private sealed class EmptyPointEnumerator : IPointEnumerator
36    {
37      public bool MoveNext()
38      {
39        return false;
40      }
41
42      public void GetCurrent(ref Point p)
43      {
44        // nothing to do
45      }
46
47      public void ApplyMappings(DependencyObject target)
48      {
49        // nothing to do
50      }
51
52      public void Dispose() { }
53    }
54  }
55}
Note: See TracBrowser for help on using the repository browser.