Exemplo n.º 1
0
        public override int Replace(Regex pattern, string replace)
        {
            int num3;
            int num = 0x12;

            if (Class191.smethod_0(pattern))
            {
                throw new ArgumentException(BookmarkStart.b("欷弹崻䰽⌿⩁摃㕅㱇㡉╋⁍㝏牑㝓㝕㙗㑙㍛⩝䁟aţ䙥൧ݩᱫᩭ९", num));
            }
            int num2 = 0;

            using (IEnumerator enumerator = this.ChildObjects.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    BodyRegion current = (BodyRegion)enumerator.Current;
                    num2 += current.Replace(pattern, replace);
                    if (base.Document.ReplaceFirst && (num2 > 0))
                    {
                        goto Label_0064;
                    }
                }
                return(num2);

Label_0064:
                num3 = num2;
            }
            return(num3);
        }
Exemplo n.º 2
0
    protected void method_7(IBody A_0)
    {
        int        num    = A_0.ChildObjects.Count - 1;
        BodyRegion region = null;

        for (int i = 0; i <= num; i++)
        {
            region = A_0.ChildObjects[i] as BodyRegion;
            DocumentObjectType documentObjectType = region.DocumentObjectType;
            switch (documentObjectType)
            {
            case DocumentObjectType.Paragraph:
            {
                bool flag = (region as Paragraph) == this.paragraph_0;
                this.method_8(region as IParagraph, flag);
                break;
            }

            case DocumentObjectType.StructureDocumentTag:
                this.method_7((region as StructureDocumentTag).SDTContent);
                break;

            default:
                if (documentObjectType == DocumentObjectType.Table)
                {
                    this.method_11(region as ITable);
                }
                break;
            }
        }
    }
Exemplo n.º 3
0
        private void method_4(BodyRegion A_0)
        {
            ParagraphBase bookmarkStart = this.CurrentBookmark.BookmarkStart;

            if (bookmarkStart != null)
            {
                bool      flag           = false;
                int       num            = bookmarkStart.method_5();
                Paragraph ownerParagraph = bookmarkStart.OwnerParagraph;
                Paragraph paragraph2     = new Paragraph(ownerParagraph.Document);
                if (bookmarkStart.NextSibling == null)
                {
                    flag = true;
                }
                if ((A_0 is Paragraph) && (bookmarkStart.NextSibling == null))
                {
                    paragraph2 = A_0 as Paragraph;
                    flag       = false;
                }
                num++;
                TextBodyPart.smethod_0(ownerParagraph, num, paragraph2);
                int index = paragraph2.method_5();
                ownerParagraph.OwnerTextBody.Items.Insert(index, A_0);
                if (((flag && (paragraph2.Text == "")) && ((bookmarkStart.OwnerBase != null) && (bookmarkStart.OwnerBase.OwnerBase != null))) && (bookmarkStart.OwnerBase.OwnerBase is Body))
                {
                    int num3 = (bookmarkStart.OwnerBase.OwnerBase as Body).Paragraphs.IndexOf(paragraph2);
                    (bookmarkStart.OwnerBase.OwnerBase as Body).Paragraphs.RemoveAt(num3);
                }
            }
        }
        private void XRayLimb(BodyRegion target)
        {
            switch (target)
            {
            case BodyRegion.LeftArm:
                _results.XRays.LeftArm.bones = (Bone[])_patient.Body.Limbs.Arms.LeftArm.Bones.Clone();
                _results.XRays.LeftArm.HasIV = _patient.AccessPoints.IVs[IVTargetLocation.ArmLeft].IsInserted;
                break;

            case BodyRegion.RightArm:
                _results.XRays.RightArm.bones = (Bone[])_patient.Body.Limbs.Arms.RightArm.Bones.Clone();
                _results.XRays.RightArm.HasIV = _patient.AccessPoints.IVs[IVTargetLocation.ArmRight].IsInserted;
                break;

            case BodyRegion.LeftLeg:
                _results.XRays.LeftLeg.bones = (Bone[])_patient.Body.Limbs.Legs.LeftLeg.Bones.Clone();
                _results.XRays.LeftLeg.HasIV = _patient.AccessPoints.IVs[IVTargetLocation.LegLeft].IsInserted;
                break;

            case BodyRegion.RightLeg:
                _results.XRays.RightLeg.bones = (Bone[])_patient.Body.Limbs.Legs.RightLeg.Bones.Clone();
                _results.XRays.RightLeg.HasIV = _patient.AccessPoints.IVs[IVTargetLocation.LegRight].IsInserted;
                break;

            case BodyRegion.None:
            case BodyRegion.Head:
            case BodyRegion.Chest:
            case BodyRegion.Abdomen:
            default:
                return;
            }
        }
Exemplo n.º 5
0
 private bool method_34(BodyRegion A_0)
 {
     if (A_0 is Paragraph)
     {
         return(this.method_35(A_0 as Paragraph));
     }
     return(this.method_36(A_0 as Table));
 }
Exemplo n.º 6
0
        public void PasteAfter(ParagraphBase paragraphItem)
        {
            BodyRegion owner     = paragraphItem.Owner as BodyRegion;
            int        itemIndex = owner.method_5();
            int        num2      = paragraphItem.method_5();

            this.PasteAt(owner.OwnerTextBody, itemIndex, num2 + 1);
        }
Exemplo n.º 7
0
 public void Copy(BodyRegion bodyItem, bool clone)
 {
     if (clone)
     {
         bodyItem = (BodyRegion)bodyItem.Clone();
     }
     this.method_4(bodyItem.Document);
     this.body_0.Items.Add(bodyItem);
 }
Exemplo n.º 8
0
        public void ReplaceBookmarkContent(TextBodyPart bodyPart, bool isKeepSourceFirstParaFormat, bool saveFormatting)
        {
            bodyPart.bool_3 = isKeepSourceFirstParaFormat;
            this.method_0(saveFormatting, false);
            BodyRegion      owner  = this.bookmark_0.BookmarkStart.Owner as BodyRegion;
            int             num    = owner.method_5();
            int             num2   = this.bookmark_0.BookmarkStart.method_5();
            CharacterFormat format = this.method_1(this.bookmark_0.BookmarkStart);

            bodyPart.method_1(owner.OwnerTextBody, num, num2 + 1, format, saveFormatting);
            bodyPart.bool_3 = false;
        }
Exemplo n.º 9
0
        static IterativeAlgorithmOutput <ISet <V> > ApplyDescendingPart <V>(List <Region> regions,
                                                                            TransferFunctionStorage <ISet <V> > functions, SetIterativeAlgorithmParameters <V> param, Graph graph)
        {
            Dictionary <int, ISet <V> >          regionsInputs = new Dictionary <int, ISet <V> >();
            IterativeAlgorithmOutput <ISet <V> > result        = new IterativeAlgorithmOutput <ISet <V> >();

            regionsInputs[regions.Count - 1] = param.FirstValue;

            Dictionary <Region, Region> parents = new Dictionary <Region, Region>();

            for (int i = regions.Count - 1; i >= 0; --i)
            {
                BodyRegion body = regions[i] as BodyRegion;
                if (body != null)
                {
                    foreach (Region r in body.Regions)
                    {
                        parents[r] = body;
                    }
                }

                LoopRegion loop = regions[i] as LoopRegion;
                if (loop != null)
                {
                    parents[loop.Body] = loop;
                }
                if (parents.ContainsKey(regions[i]))
                {
                    Region parent = parents[regions[i]];
                    regionsInputs[i] = functions[parent, RegionDirection.In, regions[i]](regionsInputs[regions.IndexOf(parent)]);
                }
            }

            int numOfBlocks = graph.Count();

            for (int i = 0; i < numOfBlocks; ++i)
            {
                var curBlock   = regions[i].Header;
                int curBlockId = curBlock.BlockId;

                result.In[curBlockId]  = regionsInputs[i];
                result.Out[curBlockId] = param.TransferFunction(regionsInputs[i], curBlock);
            }

            return(result);
        }
Exemplo n.º 10
0
    /// <summary>
    /// This returns the correct parameter name for the animator based on an isolated region.
    /// </summary>
    /// <param name="region"></param>
    /// <returns></returns>
    public static string GetAnimationIntParmeter(BodyRegion region)
    {
        switch (region)
        {
        case BodyRegion.None:
            return("BaseAnimationInt");

        case BodyRegion.LeftArm:
            return("LeftArmAnimationInt");

        case BodyRegion.RightArm:
            return("RightArmAnimationInt");

        default:
            return("BaseAnimationInt");
        }
    }
Exemplo n.º 11
0
        static TransferFunctionStorage <ISet <V> > ApplyAscendingPart <V>(Graph graph, List <Region> regions, SetIterativeAlgorithmParameters <V> param)
        {
            TransferFunctionStorage <ISet <V> > result = new TransferFunctionStorage <ISet <V> >();

            foreach (Region r in regions)
            {
                LeafRegion leaf = r as LeafRegion;
                TransferFunctionStorage <ISet <V> > clone = result.Clone();
                if (leaf != null)
                {
                    //////
                    for (int i = graph.Count(); i < regions.Count; ++i)
                    {
                        result[regions[i], RegionDirection.Out, leaf] = input => param.TransferFunction(input, leaf.Block);
                    }
                    /////
                    result[leaf, RegionDirection.In, leaf]  = Identity;
                    result[leaf, RegionDirection.Out, leaf] = input => param.TransferFunction(input, leaf.Block);
                }
                BodyRegion body = r as BodyRegion;
                if (body != null)
                {
                    foreach (Region s in body.Regions)
                    {
                        LeafRegion header = s as LeafRegion;
                        if (header != null)
                        {
                            result[body, RegionDirection.In, s] = Identity;
                        }
                        else
                        {
                            result[body, RegionDirection.In, s] = input => GatherFunctionsResults(input, clone, body, s.Header.InputBlocks, graph, param);
                        }
                        CalculateForOutputBlocks(result, body, s, s.OutputBlocks, graph);
                    }
                }
                LoopRegion loop = r as LoopRegion;
                if (loop != null)
                {
                    result[loop, RegionDirection.In, loop.Body] = input => SetFactory.GetSet <V>(input.Union(GatherFunctionsResults(input, clone, loop.Body, loop.Header.InputBlocks, graph, param)));
                    CalculateForOutputBlocks(result, loop, loop.Body, loop.OutputBlocks, graph);
                }
            }
            return(result);
        }
Exemplo n.º 12
0
        private void method_2()
        {
            int num = 9;

            if (this.body_1 == null)
            {
                throw new ArgumentNullException(BookmarkStart.b("嬮吰䬲䄴甶嘸强䐼", num));
            }
            if ((this.int_0 < 0) || (this.int_0 > this.body_1.Items.Count))
            {
                throw new ArgumentOutOfRangeException(BookmarkStart.b("䘮䔰嘲場縶圸强堼䜾", num), BookmarkStart.b("䘮䔰嘲場縶圸强堼䜾慀⩂㙄杆╈⹊㹌㱎煐❒㵔㙖㝘筚浜罞๠ᅢ䕤f᭨๪౬᭮ᑰŲ啴Ͷᅸ᩺፼彾", num) + this.body_1.Items.Count);
            }
            BodyRegion region    = (this.body_1.Items.Count > this.int_0) ? this.body_1.Items[this.int_0] : null;
            Paragraph  paragraph = region as Paragraph;

            if ((paragraph != null) && ((this.int_1 < 0) || (this.int_1 > paragraph.Items.Count)))
            {
                throw new ArgumentOutOfRangeException(BookmarkStart.b("弮砰䜲倴娶瀸唺夼娾㥀", num), BookmarkStart.b("弮砰䜲倴娶瀸唺夼娾㥀捂ⱄ㑆楈❊⡌㱎≐獒⅔㽖㡘㕚絜潞䅠ౢᝤ䝦๨ᥪ࡬๮հᙲݴ坶൸፺ᱼᅾꆀꎂ", num) + paragraph.Items.Count);
            }
        }
Exemplo n.º 13
0
        internal Table method_28(float A_0)
        {
            Table table = new Table(base.Document);

            table.ResetCells(1, 1);
            TableCell cell = table.Rows[0].Cells[0];

            cell.Width = A_0;
            table.TableFormat.Paddings.All             = 0f;
            table.TableFormat.Borders.BorderType       = BorderStyle.None;
            table.Rows[0].RowFormat.Borders.BorderType = BorderStyle.None;
            cell.CellFormat.Borders.BorderType         = BorderStyle.None;
            table.TableFormat.LayoutType = LayoutType.Fixed;
            table.IsSDTTable             = true;
            for (int i = 0; i < this.SDTContent.Items.Count; i++)
            {
                BodyRegion region = this.SDTContent.Items[i];
                cell.Items.Add(region.Clone());
            }
            table.method_0(base.Owner);
            return(table);
        }
 public ExamineSkeleton(BodyRegion target)
 {
     _target = target;
 }
Exemplo n.º 15
0
        public void PasteAfter(BodyRegion bodyItem)
        {
            int num = bodyItem.method_5();

            this.PasteAt(bodyItem.OwnerTextBody, num + 1);
        }
Exemplo n.º 16
0
        public List <Region> CreateSequence(Graph g)
        {
            if (!CheckRetreatingIsReverse.CheckRetreatingIsReverse.CheckReverseEdges(g))
            {
                Console.WriteLine("there are some retreating edges which aren't reverse");
                Environment.Exit(0);
            }
            var basicBlockLastRegion = new Dictionary <BasicBlock, Region>();

            foreach (var v in g.GetVertices())
            {
                var newReg = new LeafRegion(v);
                regionList.Add(newReg);
                basicBlockLastRegion[v] = newReg;
            }

            var loops = SearchNaturalLoops.FindAllNaturalLoops(g);

            var regionMade = new Dictionary <Edge <BasicBlock>, bool>();

            foreach (var loop in loops)
            {
                regionMade[loop.Key] = false;
            }

            while (regionMade.ContainsValue(false))
            {
                foreach (var loop in loops)
                {
                    bool anyInsideLoops = false;
                    foreach (var loopOther in loops)
                    {
                        anyInsideLoops = anyInsideLoops || checkLoopInclusion(loop, loopOther, regionMade[loopOther.Key]);
                    }
                    if (!anyInsideLoops)
                    {
                        continue;
                    }

                    regionMade[loop.Key] = true;

                    var header = loop.Key.Target;

                    var curRegions   = new List <Region>();
                    var outputBlocks = new List <int>();
                    foreach (var blockId in loop.Value)
                    {
                        var block = g.getBlockById(blockId);
                        if (!curRegions.Contains(basicBlockLastRegion[block]))
                        {
                            curRegions.Add(basicBlockLastRegion[block]);
                        }

                        foreach (var outputBlock in block.OutputBlocks)
                        {
                            if (!loop.Value.Contains(outputBlock))
                            {
                                outputBlocks.Add(block.BlockId);
                                break;
                            }
                        }
                    }

                    var bodyReg = new BodyRegion(header, outputBlocks, curRegions);
                    regionList.Add(bodyReg);

                    var loopReg = new LoopRegion(bodyReg);
                    regionList.Add(loopReg);

                    foreach (var blockId in loop.Value)
                    {
                        var block = g.getBlockById(blockId);
                        basicBlockLastRegion[block] = loopReg;
                    }
                }
            }


            // check if program has become one region
            foreach (var block in basicBlockLastRegion)
            {
                // if there are leaves not included in loops
                if (block.Value.GetType() == typeof(LeafRegion))
                {
                    var header       = g.getRoot();
                    var outputBlocks = new List <int>();
                    var curRegions   = new List <Region>();
                    foreach (var curblock in basicBlockLastRegion)
                    {
                        if (!curRegions.Contains(curblock.Value))
                        {
                            curRegions.Add(curblock.Value);
                        }
                    }
                    var newReg = new BodyRegion(header, outputBlocks, curRegions);
                    regionList.Add(newReg);
                    break;
                }
            }

            foreach (var reg in regionList)
            {
                if (reg.GetType() == typeof(LoopRegion))
                {
                    (reg as LoopRegion).Body.RegionParent = reg;
                }
                if (reg.GetType() == typeof(BodyRegion))
                {
                    foreach (var children in (reg as BodyRegion).Regions)
                    {
                        children.RegionParent = reg;
                    }
                }
            }

            return(regionList);
        }
Exemplo n.º 17
0
        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);
            }
        }
Exemplo n.º 18
0
        internal Table method_78(Interface30 A_0)
        {
            int  num   = 7;
            bool flag  = this.table_0 is Class7;
            bool flag2 = base.method_1() != null;

            if (!flag || flag2)
            {
                this.table_0 = new Class7(this);
                this.table_0.ResetCells(1, 1);
            }
            this.table_0.method_0(base.Owner);
            TableRow  row          = this.table_0.Rows[0];
            TableCell cell         = row.Cells[0];
            float     left         = 0f;
            float     top          = 0f;
            float     bottom       = 0f;
            float     right        = 0f;
            float     width        = 0f;
            float     height       = 0f;
            float     num2         = 0f;
            float     clientHeight = 0f;
            bool      flag4        = true;

            if (base.Owner != null)
            {
                for (IDocumentObject obj2 = base.Owner; !(obj2 is Section); obj2 = obj2.Owner)
                {
                    if (((obj2 is Table) && this.Format.IsAllowInCell) && !(obj2 as Table).IsSDTTable)
                    {
                        this.table_0.IsTextBoxInTable = true;
                        break;
                    }
                    if (obj2.Owner == null)
                    {
                        break;
                    }
                }
                if (A_0.imethod_0().method_28().method_30() != null)
                {
                    Section section = A_0.imethod_0().method_28().method_30() as Section;
                    left   = section.PageSetup.Margins.Left;
                    top    = section.PageSetup.Margins.Top;
                    bottom = section.PageSetup.Margins.Bottom;
                    right  = section.PageSetup.Margins.Right;
                    float footerDistance = section.PageSetup.FooterDistance;
                    float headerDistance = section.PageSetup.HeaderDistance;
                    height       = section.PageSetup.PageSize.Height;
                    width        = section.PageSetup.PageSize.Width;
                    num2         = (A_0.imethod_0().method_135() || (section.Columns.Count <= 0)) ? section.PageSetup.ClientWidth : section.Columns[A_0.imethod_3().Interface30.imethod_4()].Width;
                    clientHeight = section.PageSetup.ClientHeight;
                    if (section.Columns.Count > 1)
                    {
                        flag4 = false;
                    }
                }
            }
            if (this.Format.WidthPercent > 0f)
            {
                float num9 = 0f;
                switch (this.Format.RelationWidth)
                {
                case HorizontalOrigin.Margin:
                    num9 = (num2 * this.Format.WidthPercent) / 100f;
                    break;

                case HorizontalOrigin.Page:
                    num9 = (width * this.Format.WidthPercent) / 100f;
                    break;
                }
                if (((num9 != 0f) && (this.Format.Width != num9)) && (((this.Format.LayoutFlowAlt == TextDirection.TopToBottom) || (this.Format.LayoutFlowAlt == TextDirection.TopToBottomRotated)) || !base.ShapePr.HasKey(0x1023)))
                {
                    this.Format.Width = num9;
                }
            }
            if (this.Format.HeightPercent > 0f)
            {
                float num5 = 0f;
                switch (this.Format.RelationHeight)
                {
                case VerticalOrigin.Margin:
                    num5 = (clientHeight * this.Format.HeightPercent) / 100f;
                    break;

                case VerticalOrigin.Page:
                    num5 = (height * this.Format.HeightPercent) / 100f;
                    break;
                }
                if ((num5 != 0f) && (this.Format.Width != num5))
                {
                    this.Format.Height = num5;
                }
            }
            Color fillColor = new Color();

            if (this.Format.Opacity > 0f)
            {
                fillColor = this.Format.FillColor;
            }
            row.Height = this.Format.Height;
            cell.CellFormat.TextDirection = this.Format.LayoutFlowAlt;
            if (!this.Format.NoLine && (base.ShapeType == ShapeType.TextBox))
            {
                cell.CellFormat.Borders.LineWidth  = this.Format.LineWidth;
                cell.CellFormat.Borders.Color      = this.Format.LineColor;
                cell.CellFormat.Borders.BorderType = this.method_81(this.Format.LineStyle);
            }
            else
            {
                cell.CellFormat.Borders.BorderType = BorderStyle.None;
            }
            if (this.Format.TextWrappingStyle == TextWrappingStyle.Inline)
            {
                goto Label_1240;
            }
            switch (this.Format.VerticalOrigin)
            {
            case VerticalOrigin.Margin:
                this.table_0.TableFormat.Positioning.VertRelationTo = VerticalRelation.Margin;
                switch (this.Format.VerticalAlignment)
                {
                case ShapeVerticalAlignment.None:
                    if (Math.Abs(this.Format.TopPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = clientHeight * (this.Format.TopPercent / 100f);
                    }
                    else if (this.Format.VerticalPosition != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = this.Format.VerticalPosition;
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.VertPositionAbs = VerticalPosition.None;
                    }
                    goto Label_0995;

                case ShapeVerticalAlignment.Top:
                    if (Math.Abs(this.Format.TopPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = top * (this.Format.TopPercent / 100f);
                    }
                    else if (this.Format.VerticalPosition != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = this.Format.VerticalPosition;
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.VertPositionAbs = VerticalPosition.Top;
                    }
                    goto Label_0995;

                case ShapeVerticalAlignment.Center:
                    if (Math.Abs(this.Format.TopPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = (clientHeight / 2f) * (this.Format.TopPercent / 100f);
                    }
                    else if (this.Format.VerticalPosition != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = (clientHeight - this.Format.Height) / 2f;
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.VertPositionAbs = VerticalPosition.Center;
                    }
                    goto Label_0995;

                case ShapeVerticalAlignment.Bottom:
                    if (Math.Abs(this.Format.TopPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = ((clientHeight - this.Format.InternalMargin.Bottom) - bottom) * (this.Format.TopPercent / 100f);
                    }
                    else if (this.Format.VerticalPosition != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = clientHeight - this.Format.Height;
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.VertPositionAbs = VerticalPosition.Bottom;
                    }
                    goto Label_0995;
                }
                break;

            case VerticalOrigin.Page:
                this.table_0.TableFormat.Positioning.VertRelationTo = VerticalRelation.Page;
                switch (this.Format.VerticalAlignment)
                {
                case ShapeVerticalAlignment.None:
                    if (Math.Abs(this.Format.TopPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = height * (this.Format.TopPercent / 100f);
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = this.Format.VerticalPosition;
                    }
                    goto Label_0995;

                case ShapeVerticalAlignment.Top:
                {
                    RowFormat.TablePositioning positioning = this.table_0.TableFormat.Positioning;
                    positioning.VertPositionEx -= this.Format.InternalMargin.Top;
                    goto Label_0995;
                }

                case ShapeVerticalAlignment.Center:
                    this.table_0.TableFormat.Positioning.VertPositionEx = (height - this.Format.Height) / 2f;
                    goto Label_0995;

                case ShapeVerticalAlignment.Bottom:
                    this.table_0.TableFormat.Positioning.VertPositionEx = (height - this.Format.Height) - this.Format.InternalMargin.Bottom;
                    goto Label_0995;
                }
                break;

            case VerticalOrigin.Paragraph:
            case VerticalOrigin.Line:
                this.table_0.TableFormat.Positioning.VertRelationTo = VerticalRelation.Paragraph;
                this.table_0.TableFormat.Positioning.VertPositionEx = this.Format.VerticalPosition;
                break;

            case VerticalOrigin.TopMarginArea:
                this.table_0.TableFormat.Positioning.VertRelationTo = VerticalRelation.Page;
                if (this.Format.VerticalAlignment == ShapeVerticalAlignment.None)
                {
                    if (Math.Abs(this.Format.TopPercent) == 0f)
                    {
                        this.table_0.TableFormat.Positioning.VertPositionEx = this.Format.VerticalPosition;
                        break;
                    }
                    this.table_0.TableFormat.Positioning.VertPositionEx = height * (this.Format.TopPercent / 100f);
                }
                break;

            default:
                if (this.table_0.TableFormat.Positioning.VertPositionEx == 0f)
                {
                    this.table_0.TableFormat.Positioning.VertPositionEx = this.Format.VerticalPosition;
                }
                break;
            }
Label_0995:
            switch (this.Format.HorizontalOrigin)
            {
            case HorizontalOrigin.Margin:
                this.table_0.TableFormat.Positioning.HorizRelationTo  = HorizontalRelation.Margin;
                this.table_0.TableFormat.Positioning.HorizPositionAbs = HorizontalPosition.Left;
                switch (this.Format.HorizontalAlignment)
                {
                case ShapeHorizontalAlignment.None:
                    if (Math.Abs(this.Format.LeftPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = num2 * (this.Format.LeftPercent / 100f);
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = this.Format.HorizontalPosition;
                    }
                    break;

                case ShapeHorizontalAlignment.Left:
                    if (Math.Abs(this.Format.LeftPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = (left - this.Format.InternalMargin.Left) * (this.Format.LeftPercent / 100f);
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = this.table_0.TableFormat.LeftIndent - this.Format.InternalMargin.Left;
                    }
                    break;

                case ShapeHorizontalAlignment.Center:
                    if (Math.Abs(this.Format.LeftPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = (num2 / 2f) * (this.Format.LeftPercent / 100f);
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = (num2 - this.Format.Width) / 2f;
                    }
                    break;

                case ShapeHorizontalAlignment.Right:
                    if (Math.Abs(this.Format.LeftPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = (num2 - this.Format.InternalMargin.Right) * (this.Format.LeftPercent / 100f);
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = (num2 - this.Format.Width) - this.Format.InternalMargin.Right;
                    }
                    break;
                }
                goto Label_11AF;

            case HorizontalOrigin.Page:
                this.table_0.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Page;
                switch (this.Format.HorizontalAlignment)
                {
                case ShapeHorizontalAlignment.None:
                    if (Math.Abs(this.Format.LeftPercent) != 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = width * (this.Format.LeftPercent / 100f);
                    }
                    else
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = this.Format.HorizontalPosition;
                    }
                    break;

                case ShapeHorizontalAlignment.Left:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = 0f;
                    break;

                case ShapeHorizontalAlignment.Center:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = (width - this.Format.Width) / 2f;
                    break;

                case ShapeHorizontalAlignment.Right:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = width - this.Format.Width;
                    break;
                }
                goto Label_11AF;

            case HorizontalOrigin.Column:
                this.table_0.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Column;
                switch (this.Format.HorizontalAlignment)
                {
                case ShapeHorizontalAlignment.None:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = this.Format.HorizontalPosition;
                    break;

                case ShapeHorizontalAlignment.Left:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = this.table_0.TableFormat.LeftIndent - this.Format.InternalMargin.Left;
                    break;

                case ShapeHorizontalAlignment.Center:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = (num2 - this.Format.Width) / 2f;
                    break;

                case ShapeHorizontalAlignment.Right:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = (num2 - this.Format.Width) - this.Format.InternalMargin.Right;
                    break;
                }
                goto Label_11AF;

            case HorizontalOrigin.LeftMarginArea:
                this.table_0.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Margin;
                switch (this.Format.HorizontalAlignment)
                {
                case ShapeHorizontalAlignment.None:
                    this.table_0.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Page;
                    if (Math.Abs(this.Format.LeftPercent) == 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = this.Format.HorizontalPosition;
                        break;
                    }
                    this.table_0.TableFormat.Positioning.HorizPositionEx = width * (this.Format.LeftPercent / 100f);
                    break;

                case ShapeHorizontalAlignment.Left:
                    if (Math.Abs(this.Format.LeftPercent) == 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = -(left - this.Format.InternalMargin.Left);
                        break;
                    }
                    this.table_0.TableFormat.Positioning.HorizPositionEx = -(left - this.Format.InternalMargin.Left) * (this.Format.LeftPercent / 100f);
                    break;

                case ShapeHorizontalAlignment.Center:
                    if (Math.Abs(this.Format.LeftPercent) == 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = -(left - this.Format.Width) / 2f;
                        break;
                    }
                    this.table_0.TableFormat.Positioning.HorizPositionEx = -(left / 2f) * (this.Format.LeftPercent / 100f);
                    break;

                case ShapeHorizontalAlignment.Right:
                    if (Math.Abs(this.Format.LeftPercent) == 0f)
                    {
                        this.table_0.TableFormat.Positioning.HorizPositionEx = -(this.Format.Width + this.Format.InternalMargin.Right);
                        break;
                    }
                    this.table_0.TableFormat.Positioning.HorizPositionEx = -(left - this.Format.InternalMargin.Right) * (this.Format.LeftPercent / 100f);
                    break;
                }
                goto Label_11AF;

            case HorizontalOrigin.RightMarginArea:
                this.table_0.TableFormat.Positioning.HorizRelationTo  = HorizontalRelation.Margin;
                this.table_0.TableFormat.Positioning.HorizPositionAbs = HorizontalPosition.Left;
                switch (this.Format.HorizontalAlignment)
                {
                case ShapeHorizontalAlignment.None:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = num2 + this.Format.HorizontalPosition;
                    break;

                case ShapeHorizontalAlignment.Left:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = num2;
                    break;

                case ShapeHorizontalAlignment.Center:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = num2 + ((right - this.Format.Width) / 2f);
                    break;

                case ShapeHorizontalAlignment.Right:
                    this.table_0.TableFormat.Positioning.HorizPositionEx = (num2 + right) - this.Format.Width;
                    break;
                }
                goto Label_11AF;
            }
            if (this.table_0.TableFormat.Positioning.VertPositionEx == 0f)
            {
                this.table_0.TableFormat.Positioning.VertPositionEx = this.Format.VerticalPosition;
            }
Label_11AF:
            this.table_0.TableFormat.method_53(true);
            this.table_0.TableFormat.Positioning.DistanceFromBottom = this.Format.WrapDistanceBottom;
            this.table_0.TableFormat.Positioning.DistanceFromLeft   = this.Format.WrapDistanceLeft;
            this.table_0.TableFormat.Positioning.DistanceFromRight  = this.Format.WrapDistanceRight;
            this.table_0.TableFormat.Positioning.DistanceFromTop    = this.Format.WrapDistanceTop;
Label_1240:
            if ((this.Format.IsInGroupShape || this.Format.IsInShape) && (this.ShapeInfo != null))
            {
                this.table_0.TableFormat.method_53(true);
            }
            if (((this.Format.HorizontalOrigin == HorizontalOrigin.Column) && flag4) && !this.table_0.IsTextBoxInTable)
            {
                RowFormat.TablePositioning positioning2 = this.table_0.TableFormat.Positioning;
                positioning2.HorizPositionEx += left;
                this.table_0.TableFormat.Positioning.HorizRelationTo = HorizontalRelation.Page;
            }
            if (!this.Format.IsInShape)
            {
                cell.CellFormat.BackColor = fillColor;
            }
            if (base.ShapeType == ShapeType.TextBox)
            {
                if (this.Format.FillEfects.Type == BackgroundType.NoBackground)
                {
                    if (this.Format.TextWrappingStyle == TextWrappingStyle.InFrontOfText)
                    {
                        fillColor = this.Format.FillColor;
                    }
                    else
                    {
                        fillColor = Color.Transparent;
                    }
                }
                else if (this.Format.FillEfects.Type == BackgroundType.Gradient)
                {
                    fillColor = this.Format.FillEfects.Gradient.Color2;
                    cell.CellFormat.TextureStyle = TextureStyle.Texture30Percent;
                }
                if (!this.Format.IsInShape)
                {
                    this.table_0.TableFormat.BackColor = fillColor;
                    cell.CellFormat.BackColor          = fillColor;
                }
            }
            this.table_0.TableFormat.LayoutType      = LayoutType.Fixed;
            this.table_0.TableFormat.Paddings.Left   = this.Format.InternalMargin.Left;
            this.table_0.TableFormat.Paddings.Right  = this.Format.InternalMargin.Right;
            this.table_0.TableFormat.Paddings.Top    = this.Format.InternalMargin.Top;
            this.table_0.TableFormat.Paddings.Bottom = this.Format.InternalMargin.Bottom;
            if (!this.Format.IsFitShapeToText || (this.Format.TextBoxWrapMode != TextBoxWrapMode.None))
            {
                cell.Width = this.Format.Width;
                goto Label_150E;
            }
            cell.CellWidthType = CellWidthType.Auto;
            bool flag3 = true;

            using (IEnumerator enumerator = this.ChildObjects.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    DocumentObject current = (DocumentObject)enumerator.Current;
                    if ((current is Paragraph) && (current as Paragraph).Text.Contains(BookmarkStart.b("␬", num)))
                    {
                        goto Label_14AE;
                    }
                }
                goto Label_14C8;
Label_14AE:
                flag3 = false;
            }
Label_14C8:
            if (flag3)
            {
                cell.Width = 0f;
                this.table_0.TableFormat.LayoutType = LayoutType.AutoFit;
                this.table_0.PreferredTableWidth.method_52(FtsWidth.Auto);
            }
Label_150E:
            cell.CellFormat.VerticalAlignment = this.method_80(this.Format.TextAnchor);
            if (this.Format.IsFitShapeToText)
            {
                this.table_0.Rows[0].HeightType = TableRowHeightType.AtLeast;
            }
            else
            {
                this.table_0.Rows[0].HeightType = TableRowHeightType.Exactly;
            }
            if (!flag || flag2)
            {
                int num4  = 0;
                int count = this.Body.Items.Count;
                while (num4 < count)
                {
                    BodyRegion region = this.Body.Items[num4];
                    if ((region.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.Paragraph) && (region as Paragraph).HasSDTInlineItem)
                    {
                        Paragraph entity = region.Clone() as Paragraph;
                        entity.Items.Clear();
                        int num10 = 0;
                        int num11 = (region as Paragraph).Items.Count;
                        while (num10 < num11)
                        {
                            DocumentObject obj3 = (region as Paragraph).Items[num10];
                            if (obj3 is StructureDocumentTagInline)
                            {
                                foreach (DocumentObject obj4 in (obj3 as StructureDocumentTagInline).SDTContent.Items)
                                {
                                    entity.Items.Add(obj4.Clone());
                                }
                                entity.bool_6 = false;
                            }
                            else
                            {
                                entity.Items.Add(obj3.Clone());
                            }
                            num10++;
                        }
                        cell.Items.Add(entity);
                    }
                    else
                    {
                        cell.Items.Add(region.Clone());
                    }
                    num4++;
                }
            }
            if (this.Format.IsInShape && (this.ShapeInfo != null))
            {
                this.Format.StartPoint = this.ShapeInfo.StartPoint;
            }
            return(this.table_0);
        }