/// <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) { List <RouteMetric> tags_list = new List <RouteMetric>(); foreach (KeyValuePair <string, double> pair in tags) { RouteMetric tag = new RouteMetric(); tag.Key = pair.Key; tag.Value = pair.Value; tags_list.Add(tag); } return(tags_list.ToArray()); }
/// <summary> /// Converts to regular tags list. /// </summary> /// <param name="tags"></param> /// <returns></returns> public static List<KeyValuePair<string, double>> ConvertTo(RouteMetric[] tags) { List<KeyValuePair<string, double>> tags_list = new List<KeyValuePair<string, double>>(); if (tags != null) { foreach (RouteMetric pair in tags) { tags_list.Add(new KeyValuePair<string, double>(pair.Key, pair.Value)); } } return tags_list; }
/// <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) { List<RouteMetric> tags_list = new List<RouteMetric>(); foreach (KeyValuePair<string, double> pair in tags) { RouteMetric tag = new RouteMetric(); tag.Key = pair.Key; tag.Value = pair.Value; tags_list.Add(tag); } return tags_list.ToArray(); }