예제 #1
0
        public override void AddChild(PODSectionBase NewChild)
        {
            base.AddChild(NewChild);

            // check if list tag is given, and no sub-sections already added
            if (Tag.Tag == "over" && Sections.Count == 1 && typeof(PODSectionItem).IsAssignableFrom(NewChild.GetType()))
            {
                var item = (PODSectionItem)NewChild;
                if (item != null)
                {
                    var thistype = GetListType();
                    var othertype = item.GetListType();
                    if (thistype != othertype)
                    {
                        OverrideType(othertype);
                    }
                }
            }
        }
예제 #2
0
        public override bool ShouldParent(PODSectionBase Previous)
        {
            if (Previous != null && Previous.GetType() == typeof(PODSectionItem))
            {
                //if (Previous.Sections.Count == 0)
                {
                    var item = (PODSectionItem)Previous;
                    if (item != null && Tag.Tag == "item" && item.Tag.Tag == "over")
                    {
                        Previous.AddChild(this);
                        return true;
                    }
                    else if (item != null && Tag.Tag == "back" && item.Tag.Tag == "over")
                    {
                        var thistype = GetListType();
                        var othertype = item.GetListType();
                        if (thistype != othertype)
                        {
                            OverrideType(othertype);
                        }
                    }
                }
                //else
                //{
                //	return ShouldParent(Previous.Sections.Last());
                //}
            }

            return false;
        }