コード例 #1
0
        /// <summary>
        /// Add the specified custom sampled metric sample object to the collection
        /// </summary>
        /// <param name="newMetricSample">The new custom sampled metric object to add</param>
        public void Add(CustomSampledMetricSample newMetricSample)
        {
            if (newMetricSample == null)
            {
                throw new ArgumentNullException(nameof(newMetricSample), "A new custom sampled metric sample object must be provided to add it to the collection.");
            }

            //our base object does all the work
            base.Add(newMetricSample);
        }
コード例 #2
0
        /// <summary>
        /// Add a new custom sampled metric sample from the specified sample packet
        /// </summary>
        /// <param name="newMetricSamplePacket">The sample packet to create a new metric sample object from</param>
        internal CustomSampledMetricSample Add(CustomSampledMetricSamplePacket newMetricSamplePacket)
        {
            if (newMetricSamplePacket == null)
            {
                throw new ArgumentNullException(nameof(newMetricSamplePacket), "A new custom sampled metric sample packet object must be provided to add it to the collection.");
            }

            //now we have to create a new sample object to wrap the provided packet
            CustomSampledMetricSample newMetricSample = new CustomSampledMetricSample(m_CustomSampledMetric, newMetricSamplePacket);

            //and forward to our normal add routine
            Add(newMetricSample);

            //returning our new wrapped object
            return(newMetricSample);
        }