/// <summary>Get relation items from parent by property, relation static id.</summary> public static IList<DynamicNode> GetRelationItems(string relationStaticId, string nodeTypeAlias, DynamicNode cmsParentItem) { IList<DynamicNode> cmsItems = new List<DynamicNode>(); if(!String.IsNullOrEmpty(relationStaticId)) { return cmsParentItem.DescendantsOrSelf(x => String.Equals(x.NodeTypeAlias, nodeTypeAlias) && String.Equals(x.GetPropertyValue(RelationStaticBackofficeEvent.PROPERTYALIAS__RelationStaticId), relationStaticId)).Items; } return cmsItems; }
private DynamicNode getStream() { DynamicNode n = new DynamicNode(-1); return n.DescendantsOrSelf(StreamTypeAlias).FirstOrDefault(); }
/// <summary>Get relation item from parent by property, relation static id.</summary> public static DynamicNode GetRelationItem(string relationStaticId, string nodeTypeAlias, DynamicNode cmsParentItem) { if(!String.IsNullOrEmpty(relationStaticId)) { var cmsDescendants = cmsParentItem.DescendantsOrSelf(nodeTypeAlias).Items; var cmsDescendantsCount = cmsDescendants.Count; for(int i = 0;i < cmsDescendantsCount;i += 1) { if(String.Equals(cmsDescendants[i].GetPropertyValue(RelationStaticBackofficeEvent.PROPERTYALIAS__RelationStaticId), relationStaticId)) { return cmsDescendants[i]; } } } return null; }