public DynamicBackingItem(int Id)
        {
            if (Id == -1)
            {
                // passing in -1 needs to return a real node, the "root" node, which has no
                // properties (defaults apply) but can be used to access descendants, children, etc.

                this.content = new NodeFactory.Node(Id);
                return;
            }

            var n = LegacyNodeHelper.ConvertToNode(UmbracoContext.Current.ContentCache.GetById(Id));

            this.content = n;
            this.Type    = DynamicBackingItemType.Content;
            if (n.Id == 0 && Id != 0)
            {
                this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
                this.Type  = DynamicBackingItemType.Media;
                if (this.media == null)
                {
                    this.Type = DynamicBackingItemType.Content;
                }
                return;
            }
        }
        public dynamic NodesById(List <int> Ids, DynamicBackingItemType ItemType)
        {
            List <DynamicNode> nodes = new List <DynamicNode>();

            foreach (int eachId in Ids)
            {
                nodes.Add(new DynamicNode(eachId, ItemType));
            }
            return(new DynamicNodeList(nodes));
        }
Exemplo n.º 3
0
 public DynamicBackingItem(int Id, DynamicBackingItemType Type)
 {
     if (Type == DynamicBackingItemType.Media)
     {
         this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
         this.Type = Type;
     }
     else
     {
         this.content = CompatibilityHelper.ConvertToNode(UmbracoContext.Current.ContentCache.GetById(Id));
         this.Type = Type;
     }
 }
Exemplo n.º 4
0
 public DynamicBackingItem(int Id, DynamicBackingItemType Type)
 {
     if (Type == DynamicBackingItemType.Media)
     {
         this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
         this.Type  = Type;
     }
     else
     {
         this.content = CompatibilityHelper.ConvertToNode(UmbracoContext.Current.ContentCache.GetById(Id));
         this.Type    = Type;
     }
 }
Exemplo n.º 5
0
 public DynamicBackingItem(int Id, DynamicBackingItemType Type)
 {
     NodeFactory.Node baseNode = new NodeFactory.Node(Id);
     if (Type == DynamicBackingItemType.Media)
     {
         this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
         this.Type  = Type;
     }
     else
     {
         this.content = baseNode;
         this.Type    = Type;
     }
 }
Exemplo n.º 6
0
 public DynamicBackingItem(int Id, DynamicBackingItemType Type)
 {
     NodeFactory.Node baseNode = new NodeFactory.Node(Id);
     if (Type == DynamicBackingItemType.Media)
     {
         this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
         this.Type = Type;
     }
     else
     {
         this.content = baseNode;
         this.Type = Type;
     }
 }
 public DynamicBackingItem(int Id)
 {
     NodeFactory.Node baseNode = new NodeFactory.Node(Id);
     this.content = baseNode;
     this.Type    = DynamicBackingItemType.Content;
     if (baseNode.Id == 0 && Id != 0)
     {
         this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
         this.Type  = DynamicBackingItemType.Media;
         if (this.media == null)
         {
             this.Type = DynamicBackingItemType.Content;
         }
         return;
     }
 }
Exemplo n.º 8
0
        public DynamicBackingItem(int Id)
        {
            var n = CompatibilityHelper.ConvertToNode(UmbracoContext.Current.ContentCache.GetById(Id));

            this.content = n;
            this.Type    = DynamicBackingItemType.Content;
            if (n.Id == 0 && Id != 0)
            {
                this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
                this.Type  = DynamicBackingItemType.Media;
                if (this.media == null)
                {
                    this.Type = DynamicBackingItemType.Content;
                }
                return;
            }
        }
Exemplo n.º 9
0
        public DynamicBackingItem(int Id)
        {
            var n = CompatibilityHelper.ConvertToNode(UmbracoContext.Current.ContentCache.GetById(Id));
           
            this.content = n;
            this.Type = DynamicBackingItemType.Content;
            if (n.Id == 0 && Id != 0)
            {
                this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
                this.Type = DynamicBackingItemType.Media;
                if (this.media == null)
                {
                    this.Type = DynamicBackingItemType.Content;
                }
                return;
            }

        }
Exemplo n.º 10
0
        public DynamicBackingItem(int Id)
        {
            NodeFactory.Node baseNode = new NodeFactory.Node(Id);
           
            this.content = baseNode;
            this.Type = DynamicBackingItemType.Content;
            if (baseNode.Id == 0 && Id != 0)
            {
                this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
                this.Type = DynamicBackingItemType.Media;
                if (this.media == null)
                {
                    this.Type = DynamicBackingItemType.Content;
                }
                return;
            }

        }
Exemplo n.º 11
0
 public DynamicNode(int NodeId, DynamicBackingItemType ItemType)
 {
     this.n = new DynamicBackingItem(NodeId, ItemType);
 }
Exemplo n.º 12
0
 public DynamicBackingItem(CMSNode node)
 {
     this.content = (INode)node;
     this.Type = DynamicBackingItemType.Content;
 }
Exemplo n.º 13
0
 public DynamicBackingItem(INode iNode)
 {
     this.content = iNode;
     this.Type    = DynamicBackingItemType.Content;
 }
Exemplo n.º 14
0
 public DynamicBackingItem(ExamineBackedMedia media)
 {
     this.media = media;
     this.Type = DynamicBackingItemType.Media;
 }
Exemplo n.º 15
0
 public DynamicBackingItem(INode iNode)
 {
     this.content = iNode;
     this.Type = DynamicBackingItemType.Content;
 }
Exemplo n.º 16
0
 public DynamicBackingItem(ExamineBackedMedia media)
 {
     this.media = media;
     this.Type  = DynamicBackingItemType.Media;
 }
Exemplo n.º 17
0
 public DynamicBackingItem(CMSNode node)
 {
     this.content = (INode)node;
     this.Type    = DynamicBackingItemType.Content;
 }