Ejemplo n.º 1
0
        //enum Format { ENZ, KmOZ, KmOENZ };
        //enum DelimitedBy { Comma, Space };

        //Functie de importare a punctelor dintr-un fisier text
        public bool ImportPoints(string cale, Punct3D.Format tip, Punct3D.DelimitedBy separator)
        {
            try
            {
                cale = Path.GetFullPath(cale);
                using (StreamReader cititor = new StreamReader(cale))
                {
                    string linie;

                    while ((linie = cititor.ReadLine()) != null)
                    {
                        this.Add(Punct3D.StringToPoint(linie, tip, separator));
                    }
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        //Functie de exportare a punctelor intr-un fisier text (Atentie! Suprascriere automata!)
        public bool ExportPoints(string cale, Punct3D.Format tip, Punct3D.DelimitedBy separator, int nrZecimale, bool formatKM)
        {
            try
            {
                cale = Path.GetFullPath(cale);
                using (StreamWriter scriitor = new StreamWriter(cale))
                {
                    foreach (Punct3D punct in this)
                    {
                        scriitor.WriteLine(punct.toString(tip, separator, nrZecimale, formatKM));
                    }
                }

                return(true);
            }
            catch (SystemException e)
            {
                eroare = e;
                return(false);
            }
        }