public Item GetReferedObject() { if (RefId == null) { throw new InvalidOperationException( "Cannot get refered object because the item is not a reference."); } return(ContentDirectory.GetObject <Item> (RefId)); }
public Object CreateReference(Object target) { // TODO return actual object? That is another network call // (but we're doing network calls anyway, so it's not like // speed is SOOO important if (IsRestricted) { throw new InvalidOperationException( "A reference cannot be created because the parent object is restricted."); } var id = ContentDirectory.Controller.CreateReference(Id, target.Id); return(ContentDirectory.GetObject <Object> (id)); }
public Container GetParent () { return ParentId == "-1" ? null : ContentDirectory.GetObject<Container> (ParentId); }