Class SampleMultiPointList
A sample class that holds an internal collection, and implements the IPointList interface so that it can be used by ZedGraph as curve data.
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class SampleMultiPointList : IPointList, ICloneable
Remarks
This particular class efficiently implements the data storage so that the class can be cloned without duplicating the data points. For example, you can create a SampleMultiPointList, populate it with values, and set XData = Time and YData = Distance. You can then clone this SampleMultiPointList to a new one, and set YData = Velocity. Each of these SampleMultiPointList's can then be used as an AddCurve(String, IPointList, Color) argument, thereby plotting a distance vs time curve and a velocity vs time curve. There will still be only one copy of the data in memory.
Constructors
| Improve this Doc View SourceSampleMultiPointList()
Default constructor
Declaration
public SampleMultiPointList()
SampleMultiPointList(SampleMultiPointList)
The Copy Constructor. This method does NOT duplicate the data, it merely makes another "Window" into the same collection. You can make multiple copies and set the XData and/or YData properties to different values to plot different data, while maintaining only one copy of the original values.
Declaration
public SampleMultiPointList(SampleMultiPointList rhs)
Parameters
Type | Name | Description |
---|---|---|
SampleMultiPointList | rhs | The SampleMultiPointList from which to copy |
Fields
| Improve this Doc View SourceXData
Determines what X data will be returned by the indexer of this list.
Declaration
public PerfDataType XData
Field Value
Type | Description |
---|---|
PerfDataType |
YData
Determines what Y data will be returned by the indexer of this list.
Declaration
public PerfDataType YData
Field Value
Type | Description |
---|---|
PerfDataType |
Properties
| Improve this Doc View SourceCount
Gets the number of data points in the collection
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Item[Int32]
Indexer to access the data. This gets the appropriate data and converts to the PointPair struct that is compatible with ZedGraph. The actual data returned depends on the values of XData and YData.
Declaration
public PointPair this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The ordinal position of the desired point in the list |
Property Value
Type | Description |
---|---|
PointPair | A PointPair corresponding to the specified ordinal data position |
Methods
| Improve this Doc View SourceAdd(PerformanceData)
Adds the specified PerformanceData struct to the end of the collection.
Declaration
public int Add(PerformanceData perfData)
Parameters
Type | Name | Description |
---|---|---|
PerformanceData | perfData | A PerformanceData struct to be added |
Returns
Type | Description |
---|---|
Int32 | The ordinal position in the collection where the values were added |
Clone()
Typesafe, deep-copy clone method.
Declaration
public SampleMultiPointList Clone()
Returns
Type | Description |
---|---|
SampleMultiPointList | A new, independent copy of this class |
Insert(Int32, PerformanceData)
Insert the specified PerformanceData struct into the list at the specified ordinal location.
Declaration
public void Insert(int index, PerformanceData perfData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The ordinal location at which to insert |
PerformanceData | perfData | The PerformanceData struct to be inserted |
RemoveAt(Int32)
Remove the PerformanceData struct from the list at the specified ordinal location.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The ordinal location of the PerformanceData struct to be removed |
Explicit Interface Implementations
| Improve this Doc View SourceICloneable.Clone()
Implement the ICloneable interface in a typesafe manner by just calling the typed version of Clone()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
Object | A deep copy of this object |