Exemplo n.º 1
0
        public static void ExportLine(Line line, string header)
        {
            CheckFolder();
            XElement rootXElement = new XElement("Lines");

            rootXElement.Add(GetGeometryFromObjects.GetXElementFromLine(line));
            rootXElement.Save(Path.Combine(FolderName, GetFileName(header)));
        }
Exemplo n.º 2
0
        public static void ExportLines(IEnumerable <Line> lines, string header)
        {
            CheckFolder();
            XElement rootXElement = new XElement("Lines");

            foreach (Line line in lines)
            {
                rootXElement.Add(GetGeometryFromObjects.GetXElementFromLine(line));
            }

            rootXElement.Save(Path.Combine(FolderName, GetFileName(header)));
        }
Exemplo n.º 3
0
        public static void ExportCurves(IEnumerable <Curve> curves, string header)
        {
            CheckFolder();
            XElement root = new XElement("Curves");
            XElement linesRootXElement = new XElement("Lines");
            XElement arcsRootXElement  = new XElement("Arcs");

            foreach (Curve curve in curves)
            {
                Line line = curve as Line;
                if (line != null)
                {
                    var lineXel = GetGeometryFromObjects.GetXElementFromLine(line);
                    if (lineXel != null)
                    {
                        linesRootXElement.Add(lineXel);
                    }
                }

                Arc arc = curve as Arc;
                if (arc != null)
                {
                    var arcXel = GetGeometryFromObjects.GetXElementFromArc(arc);
                    if (arcXel != null)
                    {
                        arcsRootXElement.Add(arcXel);
                    }
                }
            }

            if (linesRootXElement.HasElements)
            {
                root.Add(linesRootXElement);
            }
            if (arcsRootXElement.HasElements)
            {
                root.Add(arcsRootXElement);
            }

            root.Save(Path.Combine(FolderName, GetFileName(header)));
        }