/// <summary> /// Returns a clone of this object. /// </summary> /// <returns></returns> public object Clone() { RouteMetric clone = new RouteMetric(); clone.Key = this.Key; clone.Value = this.Value; return(clone); }
/// <summary> /// Convert from a regular tag dictionary. /// </summary> /// <param name="tags"></param> /// <returns></returns> public static RouteMetric[] ConvertFrom(IDictionary <string, double> tags) { var tagsList = new List <RouteMetric>(); foreach (KeyValuePair <string, double> pair in tags) { RouteMetric tag = new RouteMetric(); tag.Key = pair.Key; tag.Value = pair.Value; tagsList.Add(tag); } return(tagsList.ToArray()); }
/// <summary> /// Converts to regular tags list. /// </summary> /// <param name="tags"></param> /// <returns></returns> public static List<KeyValuePair<string, double>> ConvertTo(RouteMetric[] tags) { var tagsList = new List<KeyValuePair<string, double>>(); if (tags != null) { foreach (RouteMetric pair in tags) { tagsList.Add(new KeyValuePair<string, double>(pair.Key, pair.Value)); } } return tagsList; }
/// <summary> /// Returns a clone of this object. /// </summary> /// <returns></returns> public object Clone() { RouteMetric clone = new RouteMetric(); clone.Key = this.Key; clone.Value = this.Value; return clone; }
/// <summary> /// Convert from a regular tag dictionary. /// </summary> /// <param name="tags"></param> /// <returns></returns> public static RouteMetric[] ConvertFrom(IDictionary<string, double> tags) { var tagsList = new List<RouteMetric>(); foreach (KeyValuePair<string, double> pair in tags) { RouteMetric tag = new RouteMetric(); tag.Key = pair.Key; tag.Value = pair.Value; tagsList.Add(tag); } return tagsList.ToArray(); }