public static void UnlockContent(ISegment targetSegment, IDocumentItemFactory itemFactory, IPropertiesFactory propFactory) { Location textLocation = new Location(targetSegment, true); bool isLContentFound = false; do { ILockedContent content = textLocation.ItemAtLocation as ILockedContent; if (content != null) { isLContentFound = true; int indexInParent = content.IndexInParent; ILockedContent origLContent = (ILockedContent)content.Clone(); Location lockedLocation = new Location(origLContent.Content, true); Location origLocation = new Location(CloneContainer(content.Parent), true); // create new parent subitems IAbstractMarkupDataContainer newParent = content.Parent; newParent.Clear(); int index = 0; do // loop by parent location { // take from locked selection if (index == indexInParent) { do // loop by locked content { if (lockedLocation.ItemAtLocation != null) { newParent.Add((IAbstractMarkupData)lockedLocation.ItemAtLocation.Clone()); } }while (lockedLocation.MoveNextSibling()); index++; } // take original items else { if (origLocation.ItemAtLocation != null) { newParent.Add((IAbstractMarkupData)origLocation.ItemAtLocation.Clone()); } index++; } }while (origLocation.MoveNextSibling()); } }while (textLocation.MoveNext()); if (isLContentFound) { // merge IText objects MergeMarkupData(targetSegment, itemFactory, propFactory); } }
public void VisitLockedContent(ILockedContent lockedContent) { LockedContentTags.Add((ILockedContent)lockedContent.Clone()); var objTag = new Tag { AlignmentAnchor = "", Anchor = "", TagId = lockedContent.UniqueId.ToString(), TextEquivalent = lockedContent.Content.ToString(), SectionType = Tag.Type.LockedContent }; SegmentSections.Add(objTag); PlainText.Append(lockedContent.Content); }
public void VisitLockedContent(ILockedContent lockedContent) { _currentContainer.Add((ILockedContent)lockedContent.Clone()); }
public void VisitLockedContent(ILockedContent lockedContent) { _currentContainer.Add((ILockedContent)lockedContent.Clone()); }