示例#1
0
        /// <summary>
        /// Deserializes from the library XML
        /// </summary>
        public void Load(string Path)
        {
            XmlSerializer       serializer = new XmlSerializer(typeof(CalculationsLibrary), null, new Type[] { typeof(Calculation) }, null, null);
            XmlTextReader       reader     = new XmlTextReader(new System.IO.StringReader(System.IO.File.ReadAllText(Path)));
            CalculationsLibrary library    = (CalculationsLibrary)serializer.Deserialize(reader);

            this._Calculations = library.Calculations;
            reader.Close();
        }
示例#2
0
 /// <summary>
 /// Deserializes from the library XML
 /// </summary>
 public void Load()
 {
     try
     {
         XmlSerializer       serializer = new XmlSerializer(typeof(CalculationsLibrary), null, new Type[] { typeof(Calculation) }, null, null);
         XmlTextReader       reader     = new XmlTextReader(new System.IO.StringReader(System.IO.File.ReadAllText(LibraryPath)));
         CalculationsLibrary library    = (CalculationsLibrary)serializer.Deserialize(reader);
         this._Calculations = library.Calculations;
         reader.Close();
     }
     catch (Exception ex)
     {
         string s = ex.Message;
         s = s + "";
     }
 }