/// <summary>
        /// Get Current Configured Url
        /// </summary>
        /// <returns>Current Rest Request Url</returns>
        public override string ToString()
        {
            string url = BaseUrl;

            //Add segments to base endpoint url
            if (Segments.Count > 0)
            {
                url += string.Join("/", Segments.OrderBy(s => s.Key).Select(s => s.Value.Trim('/')));
            }

            //build querystring
            if (QueryString.Count > 0)
            {
                url += "?" + QueryString.ToQueryString();
            }

            return(url);
        }
Esempio n. 2
0
        public int MoveSegment2NextPosition(Segment segment)
        {
            var orderId = -1;

            foreach (var seg in Segments.OrderBy(t => t.OrderId))
            {
                orderId++;
                seg.OrderId = orderId;
            }
            var oldIndex = Segments[Segments.IndexOf(segment)].OrderId;

            if (oldIndex == Segments.Count - 1)
            {
                return(oldIndex);
            }
            Segments.First(t => t.OrderId == oldIndex + 1).OrderId = oldIndex;
            segment.OrderId = oldIndex + 1;
            return(segment.OrderId);
        }
Esempio n. 3
0
 public IEnumerable <Segment> Get()
 {
     return(Segments.OrderBy(s => s.Position.X +
                             s.Position.Y * 1000)); // simple order lineby line.
 }