Beispiel #1
0
        public static AbstractDetailsBase CreatShape(ShapeTypes shape)
        {
            Type     type     = null;
            Assembly assembly = Assembly.Load(DllName);

            switch (shape)
            {
            case ShapeTypes.Line:
                type = assembly.GetType(LineTypeName);
                break;

            case ShapeTypes.Circle:
                type = assembly.GetType(CircleTypeName);
                break;

            case ShapeTypes.Arc:
                type = assembly.GetType(ArcTypeName);
                break;

            case ShapeTypes.PLine:
                type = assembly.GetType(PLineTypeName);
                break;
            }
            AbstractDetailsBase aShape = Activator.CreateInstance(type) as AbstractDetailsBase;

            return(aShape);
        }
Beispiel #2
0
        public void DocumentLoad(string doc)
        {
            DxfDocument dxfLoad = DxfDocument.Load(doc.ToString());

            valueList = new List <TypeParameters>();

            updateFunc = new Func <List <TypeParameters> >(() =>
            {
                #region Line Analyze

                getDetails   = ObjectFactory.CreatShape(ShapeTypes.Line);
                var lineList = getDetails.GetTypeParas(dxfLoad.Lines);
                valueList.AddRange(lineList);

                #endregion

                #region Circle Analyze

                getDetails     = ObjectFactory.CreatShape(ShapeTypes.Circle);
                var circleList = getDetails.GetTypeParas(dxfLoad.Circles);
                valueList.AddRange(circleList);

                #endregion

                #region Arc Analyze

                getDetails  = ObjectFactory.CreatShape(ShapeTypes.Arc);
                var arcList = getDetails.GetTypeParas(dxfLoad.Arcs);
                valueList.AddRange(arcList);

                #endregion
                getDetails    = ObjectFactory.CreatShape(ShapeTypes.PLine);
                var pLineList = getDetails.GetTypeParas(dxfLoad.LwPolylines);
                valueList.AddRange(pLineList);

                return(valueList);
            });
        }