Пример #1
0
 public void AddNewGraphicElement(
     DxfEntity entity,
     IGraphicElementBlock graphicElementBlock,
     GraphicElement1 graphicElement)
 {
     if (graphicElement.Geometry == null)
     {
         throw new Exception();
     }
     Graphics.EntityInfo entityInfo = new Graphics.EntityInfo()
     {
         Geometry = graphicElement.Geometry
     };
     entityInfo.GraphicElements.Add((IGraphicElement)graphicElement);
     this.dictionary_0.Add(entity, entityInfo);
     graphicElementBlock.Add((IGraphicElement)graphicElement);
 }
Пример #2
0
        public bool AddExistingGraphicElement1(
            IGraphicElementBlock graphicElementBlock,
            DxfEntity entity,
            ArgbColor color)
        {
            bool flag = true;

            Graphics.EntityInfo entityInfo;
            if (this.dictionary_0.TryGetValue(entity, out entityInfo))
            {
                GraphicElement1 graphicElement1 = entityInfo.GetGraphicElement1(color);
                if (graphicElement1 == null)
                {
                    graphicElement1 = new GraphicElement1(entityInfo.Geometry, color);
                    entityInfo.GraphicElements.Add((IGraphicElement)graphicElement1);
                }
                graphicElementBlock.Add((IGraphicElement)graphicElement1);
                flag = false;
            }
            return(flag);
        }
Пример #3
0
        public bool GetGraphicElementInsert(
            IGraphicElementBlock graphicElementBlock,
            DxfEntity insert,
            DxfLayer layer,
            EntityColor byBlockColor,
            DxfLineType byBlockLineType,
            out GraphicElementInsert graphicElement)
        {
            Graphics.EntityInfo entityInfo;
            bool flag;

            if (this.dictionary_0.TryGetValue(insert, out entityInfo))
            {
                graphicElement = entityInfo.GetGraphicElementInsert(layer, byBlockColor, byBlockLineType);
                if (graphicElement == null)
                {
                    flag           = true;
                    graphicElement = new GraphicElementInsert();
                    entityInfo.GraphicElements.Add((IGraphicElement)graphicElement);
                }
                else
                {
                    flag = false;
                }
            }
            else
            {
                graphicElement = new GraphicElementInsert();
                this.dictionary_0.Add(insert, new Graphics.EntityInfo()
                {
                    GraphicElements =
                    {
                        (IGraphicElement)graphicElement
                    }
                });
                flag = true;
            }
            graphicElementBlock.Add((IGraphicElement)graphicElement);
            return(flag);
        }
Пример #4
0
        public bool AddExistingGraphicElement2(
            IGraphicElementBlock graphicElementBlock,
            DxfEntity entity,
            ArgbColor color,
            DxfLineType lineType,
            double lineTypeScale,
            bool plinegen)
        {
            bool flag = true;

            Graphics.EntityInfo entityInfo;
            if (this.dictionary_0.TryGetValue(entity, out entityInfo))
            {
                GraphicElement2 graphicElement2 = entityInfo.GetGraphicElement2(color, lineType, lineTypeScale, plinegen);
                if (graphicElement2 == null)
                {
                    graphicElement2 = new GraphicElement2(entityInfo.Geometry, color, lineType, lineTypeScale, plinegen);
                    entityInfo.GraphicElements.Add((IGraphicElement)graphicElement2);
                }
                graphicElementBlock.Add((IGraphicElement)graphicElement2);
                flag = false;
            }
            return(flag);
        }