Beispiel #1
0
        private void method_19(object sender, int index, DxfViewport item)
        {
            DxfModel model = this.Model;

            if (model == null)
            {
                return;
            }
            item.vmethod_4(this.Model);
            item.vmethod_2((IDxfHandledObject)null);
            if (item.ViewportEntityHeader == null || !model.ViewportEntityHeaders.Contains(item.ViewportEntityHeader))
            {
                return;
            }
            model.ViewportEntityHeaders.Remove(item.ViewportEntityHeader);
        }
Beispiel #2
0
        private void method_17(object sender, int index, DxfViewport item)
        {
            DxfModel model = this.Model;

            if (model == null)
            {
                return;
            }
            item.vmethod_3(this.Model);
            item.vmethod_2((IDxfHandledObject)this.OwnerBlock);
            if (item.ViewportEntityHeader == null || model.ViewportEntityHeaders.Contains(item.ViewportEntityHeader))
            {
                return;
            }
            model.ViewportEntityHeaders.Add(item.ViewportEntityHeader);
        }
Beispiel #3
0
        private void method_18(object sender, int index, DxfViewport oldItem, DxfViewport newItem)
        {
            DxfModel model = this.Model;

            if (model == null)
            {
                return;
            }
            newItem.vmethod_3(this.Model);
            newItem.vmethod_2((IDxfHandledObject)this.OwnerBlock);
            if (newItem.ViewportEntityHeader != null && !model.ViewportEntityHeaders.Contains(newItem.ViewportEntityHeader))
            {
                model.ViewportEntityHeaders.Add(newItem.ViewportEntityHeader);
            }
            oldItem.vmethod_4(this.Model);
            oldItem.vmethod_2((IDxfHandledObject)null);
            if (oldItem.ViewportEntityHeader == null || !model.ViewportEntityHeaders.Contains(oldItem.ViewportEntityHeader))
            {
                return;
            }
            model.ViewportEntityHeaders.Remove(oldItem.ViewportEntityHeader);
        }
Beispiel #4
0
        protected override void vmethod_2()
        {
            foreach (DxfLayout layout in this.Layouts)
            {
                Class284 class284 = this.method_5(layout.Handle) as Class284;
                if (class284 != null && !class284.HasViewportHandles)
                {
                    DxfBlock ownerBlock = layout.OwnerBlock;
                    if (ownerBlock != null)
                    {
                        Class318 class318 = this.method_5(ownerBlock.Handle) as Class318;
                        if (class318 != null && class318.OrderedViewports.Count > 0)
                        {
                            layout.Viewports.AddRange((IEnumerable <DxfViewport>)class318.OrderedViewports);
                        }
                    }
                }
            }
            DxfLayout dxfLayout = this.Model.method_15();

            if (dxfLayout != null)
            {
                foreach (Class259 entityHeaderBuilder in this.ViewportEntityHeaderBuilders)
                {
                    DxfViewport viewport = ((DxfViewportEntityHeader)entityHeaderBuilder.HandledObject).Viewport;
                    if (viewport != null && !dxfLayout.Viewports.Contains(viewport))
                    {
                        dxfLayout.Viewports.Add(viewport);
                    }
                }
            }
            foreach (Class308 viewportBuilder in this.ViewportBuilders)
            {
                DxfViewport handledObject = (DxfViewport)viewportBuilder.HandledObject;
                if (viewportBuilder.EntityMode == (byte)0)
                {
                    if (viewportBuilder.ParentEntityRefHandle != 0UL)
                    {
                        DxfBlock dxfBlock = this.method_4 <DxfBlock>(viewportBuilder.ParentEntityRefHandle);
                        handledObject.vmethod_2((IDxfHandledObject)dxfBlock);
                        if (dxfBlock.Layout != null && !dxfBlock.Layout.Viewports.Contains(handledObject))
                        {
                            dxfBlock.Layout.Viewports.Add(handledObject);
                        }
                    }
                }
                else if (viewportBuilder.EntityMode == (byte)1)
                {
                    if (this.PaperSpaceBlockRecordHandle != 0UL)
                    {
                        DxfBlock dxfBlock = this.method_4 <DxfBlock>(this.PaperSpaceBlockRecordHandle);
                        if (dxfBlock != null && dxfBlock.Layout != null && !dxfBlock.Layout.Viewports.Contains(handledObject))
                        {
                            dxfBlock.Layout.Viewports.Add(handledObject);
                        }
                    }
                }
                else if (viewportBuilder.EntityMode == (byte)2 && this.ModelSpaceBlockRecordHandle != 0UL)
                {
                    DxfBlock dxfBlock = this.method_4 <DxfBlock>(this.ModelSpaceBlockRecordHandle);
                    if (dxfBlock != null && dxfBlock.Layout != null && !dxfBlock.Layout.Viewports.Contains(handledObject))
                    {
                        dxfBlock.Layout.Viewports.Add(handledObject);
                    }
                }
            }
        }
Beispiel #5
0
        protected override void vmethod_2()
        {
            this.ViewportBuilders.Sort((Comparison <Class308>)((a, b) =>
            {
                int num1 = 0;
                int num2 = 0;
                if (a.Id.HasValue)
                {
                    num1 = a.Id.Value;
                }
                if (b.Id.HasValue)
                {
                    num2 = b.Id.Value;
                }
                return(num1 >= num2 ? (num1 <= num2 ? 0 : 1) : -1);
            }));
            DxfLayout dxfLayout1 = (DxfLayout)null;

            foreach (DxfLayout layout in (KeyedDxfHandledObjectCollection <string, DxfLayout>) this.Model.Layouts)
            {
                if (layout.PaperSpace)
                {
                    dxfLayout1 = layout;
                    break;
                }
            }
            foreach (Class285 viewportBuilder in this.ViewportBuilders)
            {
                DxfViewport entity = (DxfViewport)viewportBuilder.Entity;
                if (entity.OwnerObjectSoftReference == null)
                {
                    DxfLayout dxfLayout2 = (DxfLayout)null;
                    if (entity.PersistentReactorCount > 0)
                    {
                        foreach (DxfHandledObject persistentReactor in entity.PersistentReactors)
                        {
                            DxfBlock dxfBlock = persistentReactor as DxfBlock;
                            if (dxfBlock != null && dxfBlock.Layout != null)
                            {
                                entity.vmethod_2((IDxfHandledObject)dxfBlock);
                                dxfLayout2 = dxfBlock.Layout;
                                break;
                            }
                        }
                    }
                    if (dxfLayout2 == null)
                    {
                        if (entity.PaperSpace && dxfLayout1 != null)
                        {
                            dxfLayout1.Viewports.Add(entity);
                        }
                        else
                        {
                            this.Model.ModelLayout.Viewports.Add(entity);
                        }
                    }
                    else
                    {
                        dxfLayout2.Viewports.Add(entity);
                    }
                }
                else
                {
                    DxfLayout layout = ((DxfBlock)entity.OwnerObjectSoftReference).Layout;
                    if (layout == null)
                    {
                        this.Model.ModelLayout.Viewports.Add(entity);
                    }
                    else
                    {
                        layout.Viewports.Add(entity);
                    }
                }
            }
        }