Ejemplo n.º 1
0
        public override void Remove(BuildTopicTocInfo item)
        {
            if (item == null)
            {
                return;
            }
            if (_listTopics == null || _listTopics.Count == 0)
            {
                return;
            }

            if (!_listTopics.Remove(item))
            {
                BuildTopicTocInfo parent = item.Parent;
                if (parent != null)
                {
                    parent.Remove(item);
                }
            }
        }
Ejemplo n.º 2
0
        private void RemoveMarker(ConceptualGroupTocInfo groupTocInfo,
                                  ConceptualMarkerTopic markerTopic, BuildContext context)
        {
            BuildTopicTocInfo markerTocInfo =
                groupTocInfo.Find(markerTopic.TopicId, true);

            if (markerTocInfo == null)
            {
                return;
            }

            //groupTocInfo.Remove(markerTocInfo);
            BuildTopicTocInfo markerParent = markerTocInfo.Parent;

            if (markerParent != null)
            {
                markerParent.Remove(markerTocInfo);
            }
            else
            {
                groupTocInfo.Remove(markerTocInfo);
            }
        }
Ejemplo n.º 3
0
        private void ProcessMarker(ConceptualGroupTocInfo groupTocInfo,
                                   ConceptualMarkerTopic markerTopic, BuildContext context)
        {
            BuildTopicTocInfo markerTocInfo =
                groupTocInfo.Find(markerTopic.TopicId, true);

            if (markerTocInfo == null)
            {
                return;
            }

            BuildTocContext tocContext = context.TocContext;

            BuildGroupTocInfo sourceTocInfo = null;

            switch (markerTopic.SourceType)
            {
            case BuildTocInfoType.Topic:
                BuildTopicTocInfo topicTocInfo = tocContext[markerTopic.SourceId];
                if (topicTocInfo == null)
                {
                    BuildTopicTocInfo markerParent = markerTocInfo.Parent;
                    if (markerParent != null)
                    {
                        markerParent.Remove(markerTocInfo);
                    }
                    else
                    {
                        groupTocInfo.Remove(markerTocInfo);
                    }
                }
                else
                {
                    groupTocInfo.Replace(markerTocInfo, topicTocInfo);

                    // Now, exclude the topic from being included in
                    // the final merging operation...
                    sourceTocInfo = tocContext.GroupOf(topicTocInfo.Name);
                    if (sourceTocInfo != null)
                    {
                        if (sourceTocInfo.ItemType == BuildTocInfoType.Conceptual)
                        {
                            if (_pendindDelete == null)
                            {
                                _pendindDelete = new List <PendingDeletePair>();
                            }

                            // For the conceptual group, we make room for
                            // nested markers, and suspend the deletion...
                            _pendindDelete.Add(new PendingDeletePair(
                                                   topicTocInfo, groupTocInfo));
                        }
                        else if (sourceTocInfo.ItemType == BuildTocInfoType.Reference)
                        {
                            sourceTocInfo.Remove(topicTocInfo);
                        }
                    }
                }
                break;

            case BuildTocInfoType.Reference:
            case BuildTocInfoType.Conceptual:
                sourceTocInfo = tocContext.Items[markerTopic.SourceId];
                if (sourceTocInfo == null)
                {
                    //groupTocInfo.Remove(markerTocInfo);
                    BuildTopicTocInfo markerParent = markerTocInfo.Parent;
                    if (markerParent != null)
                    {
                        markerParent.Remove(markerTocInfo);
                    }
                    else
                    {
                        groupTocInfo.Remove(markerTocInfo);
                    }
                }
                else
                {
                    groupTocInfo.Replace(markerTocInfo, sourceTocInfo);

                    // Now, exclude the source group from being included in
                    // the final merging operation...
                    sourceTocInfo.Exclude = true;

                    TocMerge sourceToc = _listTocMerges[markerTopic.SourceId];
                    if (sourceToc != null)
                    {
                        sourceToc.IsIncluded = false;
                    }
                }
                break;
            }
        }