コード例 #1
0
        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);
        }
コード例 #2
0
 public NavigationUrlQuery(NavigationUrlQuery other)
 {
     foreach (var pair in other.parameters)
     {
         this.parameters[pair.Key] = pair.Value;
     }
 }
コード例 #3
0
 private NavigationUrlQueryParser(bool isSuccess, NavigationUrlQuery query)
 {
     this.isSuccess = isSuccess;
     this.query     = query;
 }
コード例 #4
0
 public NavigationUrlQueryParser(NavigationUrlQuery query) : this(true, query)
 {
 }
コード例 #5
0
 public NavigationUrlSegment(string value, NavigationUrlQuery query)
 {
     this.Query = query;
     this.Value = value;
 }