Пример #1
0
        protected override object CloneImpl()
        {
            StructureDocumentTagCell cell = (StructureDocumentTagCell)base.CloneImpl();

            cell.sdtproperties_0 = this.SDTProperties.method_9();
            cell.sdtproperties_0.method_7(cell);
            return(cell);
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
        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);
                        }
                    }
                }
            }
        }