public static IEnumerable <DebugCurve> ReadFromFile(string fileName)
        {
            Stream stream           = File.Open(fileName, FileMode.Open);
            var    bformatter       = new BinaryFormatter();
            DebugCurveCollection dc = null;

            try {
                dc = bformatter.Deserialize(stream) as DebugCurveCollection;
            }
            catch (SerializationException e) {
                System.Diagnostics.Debug.WriteLine(e.ToString());
            }
            stream.Close();
            return(new List <DebugCurve>(dc.DebugCurvesArray));
        }
Exemplo n.º 2
0
        public static IEnumerable <DebugCurve> ReadFromFile(string fileName)
        {
            Stream stream           = File.Open(fileName, FileMode.Open);
            var    bformatter       = new DataContractSerializer(typeof(DebugCurve));
            DebugCurveCollection dc = null;

            try {
                dc = bformatter.ReadObject(stream) as DebugCurveCollection;
            }
            catch (SerializationException e) {
                Debug.WriteLine(e.ToString());
            }
            stream.Dispose();
            return(new List <DebugCurve>(dc.DebugCurvesArray));
        }