示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
		public Container GetParent ()
		{
			return ParentId == "-1" ? null : ContentDirectory.GetObject<Container> (ParentId);
		}