}
// Properties
-
+
public string AbsolutePath {
get { return path; }
}
public string AbsoluteUri {
- get {
- if (cachedAbsoluteUri == null)
- cachedAbsoluteUri = GetLeftPart (UriPartial.Path) + query + fragment;
+ get {
+ if (cachedAbsoluteUri == null) {
+// cachedAbsoluteUri = GetLeftPart (UriPartial.Path) + query + fragment;
+ string qf = IsFile ? query + fragment : EscapeString (query + fragment);
+ cachedAbsoluteUri = GetLeftPart (UriPartial.Path) + qf;
+ }
return cachedAbsoluteUri;
}
}
uri = new Uri (s);
}
- return ((this.scheme == uri.scheme) &&
- (this.userinfo == uri.userinfo) &&
- (this.host == uri.host) &&
- (this.port == uri.port) &&
- (this.path == uri.path) &&
- (this.query == uri.query));
+ return ((this.scheme.ToLower () == uri.scheme.ToLower ()) &&
+ (this.userinfo.ToLower () == uri.userinfo.ToLower ()) &&
+ (this.host.ToLower () == uri.host.ToLower ()) &&
+ (this.port == uri.port) &&
+ (this.path == uri.path) &&
+ (this.query.ToLower () == uri.query.ToLower ()));
}
public override int GetHashCode ()
{
if (cachedToString != null)
return cachedToString;
- if (IsFile && !IsUnc)
- cachedToString = Unescape (AbsoluteUri);
- else
- cachedToString = AbsoluteUri;
+ cachedToString = Unescape (AbsoluteUri);
return cachedToString;
}
s.Append (HexUnescape (str, ref i));
i--;
} else
- s.Append (c);
+ s.Append (c);
}
return s.ToString ();
}
path = Reduce (path);
}
- public static string Reduce (string path)
+ private static string Reduce (string path)
{
path = path.Replace ('\\','/');
string [] parts = path.Split ('/');