Esempio n. 1
0
        public void Read(string fileName)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException("fileName");
            }

            if (!File.Exists(fileName))
            {
                throw new FileNotFoundException("Plot file not found", fileName);
            }

            try
            {
                FileName = Path.GetFileName(fileName);
                using (var inStream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
                {
                    PiaSerializer.Deserialize(inStream, this);
                    inStream.Close();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        protected internal PiaNode(string innerData)
        {
            ChildNodes = new List <PiaNode>();
            Values     = new Dictionary <string, string>();

            PiaSerializer._deserializeNode(this, innerData);
        }
Esempio n. 3
0
 public void Write(string fileName)
 {
     try
     {
         using (var outStream = new FileStream(fileName, FileMode.Create, FileAccess.Write))
         {
             PiaSerializer.Serialize(outStream, this);
             outStream.Close();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }