Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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());
        }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
 /// <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;
 }
Ejemplo n.º 5
0
 /// <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();
 }