Permalink
Browse files

added an interface for subUrl

  • Loading branch information...
1 parent 14dfd7f commit 9a52aec8039d05c2889fa5f15dfb8139b3d6f061 @vurt007 vurt007 committed Apr 22, 2012
Showing with 17 additions and 1 deletion.
  1. BIN src/Snooze.ncrunchsolution.user
  2. +17 −1 src/Snooze/SubUrl.cs
Binary file not shown.
View
@@ -12,7 +12,7 @@ namespace Snooze
/// </summary>
/// <typeparam name = "TParentUrl">Type of parent URL.</typeparam>
[SubUrl]
- public abstract class SubUrl<TParentUrl> : Url
+ public abstract class SubUrl<TParentUrl> : Url, ISubUrl
where TParentUrl : Url
{
public TParentUrl Parent { get; set; }
@@ -28,5 +28,21 @@ void EnsureParentNotNull()
{
if (Parent == null) throw new InvalidOperationException("Parent Url is null.");
}
+
+ public Url GetParentUrl()
+ {
+ return Parent;
+ }
+
+ public Type GetParentUrlType()
+ {
+ return typeof (TParentUrl);
+ }
+ }
+
+ public interface ISubUrl
+ {
+ Url GetParentUrl();
+ Type GetParentUrlType();
}
}

0 comments on commit 9a52aec

Please sign in to comment.