FromStrings() public static method

Builds an enumerable of UriPathSegment objects from an enumerable of String Array.
public static FromStrings ( IEnumerable segments ) : IEnumerable
segments IEnumerable of strings.
return IEnumerable
Esempio n. 1
0
        /// <summary>
        /// Called when the <see cref="Path"/> needs to be parsed.
        /// </summary>
        protected virtual void OnParsePath()
        {
            if (!string.IsNullOrEmpty(PathInternal))
            {
                var segments = InternalPathSegments;
                segments.Clear();

                foreach (var segment in UriPathSegment.FromStrings(UriPathSegment.GetPathSegments(PathInternal)))
                {
                    if (segment != null)
                    {
                        LinkSegment(segment);
                        segments.Add(segment);
                    }
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Builds a local path from the specified segments.
 /// </summary>
 /// <param name="segments">Array of path segments.</param>
 public SDataUri BuildLocalPath(params string[] segments)
 {
     return(BuildLocalPath(UriPathSegment.FromStrings(segments)));
 }
Esempio n. 3
0
 /// <summary>
 /// Sets the path for the <see cref="Uri"/>.
 /// </summary>
 /// <param name="segments">The path segments for the <see cref="Uri"/>.</param>
 public UriFormatter SetPath(params string[] segments)
 {
     return(SetPath(UriPathSegment.FromStrings(segments)));
 }