예제 #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);
        }
예제 #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());
        }
예제 #3
0
파일: Route.cs 프로젝트: cmberryau/routing
 /// <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;
 }
예제 #4
0
파일: Route.cs 프로젝트: cmberryau/routing
 /// <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;
 }
예제 #5
0
파일: Route.cs 프로젝트: cmberryau/routing
 /// <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();
 }