Exemplo n.º 1
0
        public string[] GetTrafficTypes()
        {
            var results      = new List <string>();
            var trafficTypes = AnalyticsHelper.GetTrafficTypes();

            foreach (var type in trafficTypes)
            {
                results.Add(type.Text);
                results.Add(GetColorIndexByTrafficType(type.Type).ToString());
            }

            return(results.ToArray());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the type of the color index by traffic.
        /// </summary>
        /// <param name="trafficType">Type of the traffic.</param>
        /// <returns>Color by traffic type.</returns>
        private static int GetColorIndexByTrafficType(int trafficType)
        {
            var trafficTypes = AnalyticsHelper.GetTrafficTypes();

            for (int i = 0; i < trafficTypes.Count(); i++)
            {
                if (trafficTypes.ElementAt(i).Type == trafficType)
                {
                    return(i);
                }
            }

            return(0);
        }