public bool StartsWith(XRI xri)
{
if (xri.Authority == null)
return (true);
if (xri.Authority != null && this.Authority == null)
return (false);
if (!this.Authority.Equals(xri.Authority))
return (false);
if (xri.Path == null)
return (true);
if (xri.Path != null && this.Path == null)
return (false);
IList<XRISegment> thisSegments = this.Path.Segments;
IList<XRISegment> xriSegments = xri.Path.Segments;
if (thisSegments.Count < xriSegments.Count)
return (false);
for (int i = 0; i < xriSegments.Count; i++)
{
if (!(thisSegments[i].Equals(xriSegments[i])))
return (false);
}
return (true);
}