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)
        {
            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());
        }
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)
 {
     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;
 }
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)
 {
     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();
 }