public NavigationUrl Build(Action <NavigationUrlQuery> updateQuery = null)
        {
            var newQuery = new NavigationUrlQuery(url.Segments.Last().Query);
            var segments = new List <NavigationUrlSegment>();

            for (int i = 0; i < this.url.Segments.Count(); i++)
            {
                var segment = this.url.Segments[i];
                if (i == this.url.Segments.Length - 1)
                {
                    segment = new NavigationUrlSegment(segment.Value, newQuery);
                }
                else
                {
                    segment = new NavigationUrlSegment(segment.Value);
                }

                segments.Add(segment);
            }

            updateQuery?.Invoke(newQuery);
            var newUrl = new NavigationUrl(segments.ToArray());

            return(newUrl);
        }
Esempio n. 2
0
 public NavigationUrlQuery(NavigationUrlQuery other)
 {
     foreach (var pair in other.parameters)
     {
         this.parameters[pair.Key] = pair.Value;
     }
 }
 private NavigationUrlQueryParser(bool isSuccess, NavigationUrlQuery query)
 {
     this.isSuccess = isSuccess;
     this.query     = query;
 }
 public NavigationUrlQueryParser(NavigationUrlQuery query) : this(true, query)
 {
 }
Esempio n. 5
0
 public NavigationUrlSegment(string value, NavigationUrlQuery query)
 {
     this.Query = query;
     this.Value = value;
 }