protected override object CloneImpl() { StructureDocumentTag tag = (StructureDocumentTag)base.CloneImpl(); tag.sdtproperties_0 = this.SDTProperties.method_9(); tag.sdtproperties_0.method_7(tag); tag.sdtcontent_0 = this.SDTContent.method_45(); tag.sdtcontent_0.method_0(tag); return(tag); }
internal SDTContent(Document A_0, StructureDocumentTag A_1) : base(A_0, A_1) { }
internal void method_8() { TextRange range; SdtDropDownListBase controlProperties; switch (this.SDTType) { case SdtType.ComboBox: case SdtType.DropDownList: { controlProperties = this.ControlProperties as SdtDropDownListBase; range = null; if (!(this.documentObject_0 is StructureDocumentTagCell)) { if (this.documentObject_0 is StructureDocumentTagInline) { StructureDocumentTagInline inline3 = this.documentObject_0 as StructureDocumentTagInline; if (inline3.ChildObjects.Count > 0) { range = inline3.ChildObjects[0] as TextRange; } } else if (this.documentObject_0 is StructureDocumentTag) { StructureDocumentTag tag = this.documentObject_0 as StructureDocumentTag; if (((tag.ChildObjects.Count > 0) && (tag.ChildObjects[0] is Paragraph)) && ((tag.ChildObjects[0] as Paragraph).ChildObjects.Count > 0)) { range = (tag.ChildObjects[0] as Paragraph).ChildObjects[0] as TextRange; } } break; } StructureDocumentTagCell cell = this.documentObject_0 as StructureDocumentTagCell; if (((cell.ChildObjects.Count > 0) && (cell.ChildObjects[0] is Paragraph)) && ((cell.ChildObjects[0] as Paragraph).ChildObjects.Count > 0)) { range = (cell.ChildObjects[0] as Paragraph).ChildObjects[0] as TextRange; } break; } case SdtType.Picture: { SdtPicture picture = this.ControlProperties as SdtPicture; Image image = picture.Image; if (image != null) { DocPicture picture2 = null; if (this.documentObject_0 is StructureDocumentTagCell) { StructureDocumentTagCell cell2 = this.documentObject_0 as StructureDocumentTagCell; if (((cell2.ChildObjects.Count > 0) && (cell2.ChildObjects[0] is Paragraph)) && ((cell2.ChildObjects[0] as Paragraph).ChildObjects.Count > 0)) { picture2 = (cell2.ChildObjects[0] as Paragraph).ChildObjects[0] as DocPicture; } } else if (this.documentObject_0 is StructureDocumentTagInline) { StructureDocumentTagInline inline = this.documentObject_0 as StructureDocumentTagInline; if (inline.ChildObjects.Count > 0) { picture2 = inline.ChildObjects[0] as DocPicture; } } else if (this.documentObject_0 is StructureDocumentTag) { StructureDocumentTag tag3 = this.documentObject_0 as StructureDocumentTag; if (((tag3.ChildObjects.Count > 0) && (tag3.ChildObjects[0] is Paragraph)) && ((tag3.ChildObjects[0] as Paragraph).ChildObjects.Count > 0)) { picture2 = (tag3.ChildObjects[0] as Paragraph).ChildObjects[0] as DocPicture; } } if (picture2 != null) { picture2.method_89(image); this.IsShowingPlaceHolder = false; picture.Image = null; } } return; } case SdtType.CheckBox: { SdtCheckBox box = this.ControlProperties as SdtCheckBox; TextRange range2 = null; if (this.documentObject_0 is StructureDocumentTagCell) { StructureDocumentTagCell cell3 = this.documentObject_0 as StructureDocumentTagCell; if (((cell3.ChildObjects.Count > 0) && (cell3.ChildObjects[0] is Paragraph)) && ((cell3.ChildObjects[0] as Paragraph).ChildObjects.Count > 0)) { range2 = (cell3.ChildObjects[0] as Paragraph).ChildObjects[0] as TextRange; } } else if (this.documentObject_0 is StructureDocumentTagInline) { StructureDocumentTagInline inline2 = this.documentObject_0 as StructureDocumentTagInline; if (inline2.ChildObjects.Count > 0) { range2 = inline2.ChildObjects[0] as TextRange; } } else if (this.documentObject_0 is StructureDocumentTag) { StructureDocumentTag tag2 = this.documentObject_0 as StructureDocumentTag; if (((tag2.ChildObjects.Count > 0) && (tag2.ChildObjects[0] is Paragraph)) && ((tag2.ChildObjects[0] as Paragraph).ChildObjects.Count > 0)) { range2 = (tag2.ChildObjects[0] as Paragraph).ChildObjects[0] as TextRange; } } if (range2 != null) { if (box.Checked) { range2.Text = ((char)box.CheckedState.method_3()).ToString(); return; } range2.Text = ((char)box.UncheckedState.method_3()).ToString(); } return; } default: return; } if ((range != null) && (controlProperties.ListItems.SelectedValue != null)) { if (!this.IsShowingPlaceHolder) { range.CharacterFormat.method_55(Color.Empty); range.CharacterFormat.TextBackgroundColor = Color.Empty; } range.Text = controlProperties.ListItems.SelectedValue.DisplayText; } }
public void Copy(TextBodySelection textSel) { this.method_4(textSel.TextBody.Document); int itemStartIndex = textSel.ItemStartIndex; int itemEndIndex = textSel.ItemEndIndex; for (int i = itemStartIndex; i <= itemEndIndex; i++) { BodyRegion entity = (BodyRegion)textSel.TextBody.Items[i].Clone(); if ((i == itemStartIndex) || (i == itemEndIndex)) { if (entity.DocumentObjectType == DocumentObjectType.StructureDocumentTag) { if (i == itemStartIndex) { StructureDocumentTag tag = entity as StructureDocumentTag; for (int j = textSel.ItemStartIndexInSDT - 1; j >= 0; j--) { tag.ChildObjects.InnerList.RemoveAt(j); } DocumentObject firstItem = tag.ChildObjects.FirstItem; if (firstItem is Paragraph) { Paragraph paragraph3 = firstItem as Paragraph; for (int k = textSel.ParagraphItemStartIndex - 1; k >= 0; k--) { paragraph3.Items.InnerList.RemoveAt(k); } } } if (i == itemEndIndex) { StructureDocumentTag tag2 = entity as StructureDocumentTag; int index = textSel.ItemEndIndexInSDT + 1; while (index < tag2.ChildObjects.Count) { tag2.ChildObjects.InnerList.RemoveAt(index); } DocumentObject lastItem = tag2.ChildObjects.LastItem; if (lastItem is Paragraph) { Paragraph paragraph = lastItem as Paragraph; int num5 = textSel.ParagraphItemEndIndex + 1; while (num5 < paragraph.Items.Count) { paragraph.Items.InnerList.RemoveAt(num5); } } } } else if (entity.DocumentObjectType == DocumentObjectType.Paragraph) { Paragraph paragraph2 = entity as Paragraph; if (i == itemEndIndex) { int num4 = textSel.ParagraphItemEndIndex + 1; while (num4 < paragraph2.Items.Count) { paragraph2.Items.InnerList.RemoveAt(num4); } } if (i == itemStartIndex) { for (int m = textSel.ParagraphItemStartIndex - 1; m >= 0; m--) { paragraph2.Items.InnerList.RemoveAt(m); } } } } this.body_0.Items.Add(entity); } }
private void method_4(DocumentObject A_0, string A_1) { int num = 12; if (A_0 != null) { ParagraphBase base2 = null; switch (this.SDTType) { case SdtType.Picture: { base2 = new DocPicture(A_0.Document); byte[] imageBytes = Convert.FromBase64String(A_1.Replace(BookmarkStart.b("㠱", num), string.Empty).Replace(BookmarkStart.b("㤱", num), string.Empty).Replace(BookmarkStart.b("㼱", num), string.Empty)); (base2 as DocPicture).LoadImage(imageBytes); break; } case SdtType.Text: case SdtType.None: base2 = new TextRange(A_0.Document); (base2 as TextRange).Text = A_1; break; case SdtType.DatePicker: { DateTime time; base2 = new TextRange(A_0.Document); if (string.IsNullOrEmpty(A_1)) { (base2 as TextRange).Text = A_1; break; } string dateFormat = (this.ControlProperties as SdtDate).DateFormat; CultureInfo provider = (this.ControlProperties as SdtDate).method_1(); if (!DateTime.TryParse(A_1, out time)) { (base2 as TextRange).Text = A_1; break; } A_1 = !string.IsNullOrEmpty(dateFormat) ? time.ToString(dateFormat, provider) : time.ToString(); (base2 as TextRange).Text = A_1; break; } } if (base2 != null) { if (A_0 is StructureDocumentTag) { StructureDocumentTag tag = A_0 as StructureDocumentTag; if (tag.ChildObjects.Count > 0) { Paragraph paragraph2 = tag.ChildObjects[0] as Paragraph; this.method_5(paragraph2, base2); } } else if (A_0 is StructureDocumentTagInline) { StructureDocumentTagInline inline = A_0 as StructureDocumentTagInline; if (inline.ChildObjects.Count > 0) { base2.CharacterFormat.method_27((inline.ChildObjects[0] as ParagraphBase).CharacterFormat); if (!this.IsDataBindingOfCoreProperties && base2.CharacterFormat.HasValue(9)) { base2.CharacterFormat.Remove(9); } } inline.ChildObjects.Clear(); inline.ChildObjects.Add(base2); } else if (!(A_0 is StructureDocumentTagRow) && (A_0 is StructureDocumentTagCell)) { StructureDocumentTagCell cell = A_0 as StructureDocumentTagCell; if (cell.ChildObjects.Count > 0) { Paragraph paragraph = cell.ChildObjects[0] as Paragraph; this.method_5(paragraph, base2); } } } } }