Ejemplo n.º 1
0
		static public FileModel ParseFile(FileModel fileModel)
		{
			string src;
			using( StreamReader sr = new StreamReader(fileModel.FileName) )
			{
				src = sr.ReadToEnd();
				sr.Close();
			}
			ASFileParser parser = new ASFileParser();
			try
			{
				fileModel.LastWriteTime = File.GetLastWriteTime(fileModel.FileName);
				if (parentPath != null) 
					cacheLastWriteTime = fileModel.LastWriteTime;
				parser.ParseSrc(fileModel, src);
			}
			catch(Exception ex)
			{
				System.Windows.Forms.MessageBox.Show("Error while parsing the file:\n"+fileModel.FileName, "Error: "+ex.Message, 
				                                    System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
			}
			return fileModel;
		}