Post

Chromatogram.Resize

Replaces the data points with a new, empty array of the given size.


Remarks

Existing points are discarded, and Count is set to the new size. Use Resize rather than assigning DataPoints directly, which does not update Count.


Syntax

SyntaxDescription
Resize(int sz)Replaces the data points with a new, empty array of the given size. Existing points are discarded.

Parameters

NameTypeDescription
szintThe new number of data points.

Example

1
2
3
4
5
6
7
8
using Nova.Data;

Chromatogram chromat = new Chromatogram();
chromat.Resize(3);
chromat.DataPoints[0] = new ChromatDataPoint { RT = 10.0, Intensity = 1200 };
chromat.DataPoints[1] = new ChromatDataPoint { RT = 10.5, Intensity = 5400 };
chromat.DataPoints[2] = new ChromatDataPoint { RT = 11.0, Intensity = 2100 };
Console.WriteLine(chromat.Count);   // 3
This post is licensed under CC BY 4.0 by the author.

Trending Tags