/// <summary> /// Copy the entire collection of metric samples into a new array. /// </summary> /// <returns>A new array containing all of the metric samples in this collection.</returns> public IMetricSample[] ToArray() { MetricSample[] array; lock (m_Lock) { int count = Count; array = new MetricSample[count]; CopyTo(array, 0); } return(array); }
/// <summary> /// Determines if the provided object is identical to this object. /// </summary> /// <param name="obj">The object to compare this object to</param> /// <returns>True if the other object is also a MetricSample and represents the same data.</returns> public override bool Equals(object obj) { MetricSample otherMetricSample = obj as MetricSample; return(Equals(otherMetricSample)); // Just have type-specific Equals do the check (it even handles null) }