Exemplo n.º 1
0
		public void ShowFields()
		{
			var fileNames = ImportFiles.GetFiles(base.ConsoleX);
			foreach(var fileName in fileNames)
			{
				var reader = new S82Reader(fileName);
				ConsoleX.WriteLine("Reading fields from " + reader.FilePath, ConsoleColor.Green);
				
				foreach(var key in reader.Keys)
				{
					// Get the value for the key, and tidy it up a little.
					var val = reader[key];
					ConsoleX.WriteLine("Field= \"" + key + "\", Value = " + val);
				}
				
//				var key = "Text3";
//				var val = reader[key];
//				ConsoleX.WriteLine("Field= \"" + key + "\", Value = " + val);
//				ConsoleX.WriteLine("Parsed as: " + reader.GetDateTimeValue(key).ToLongDateString());
//
//				key = "Text4";
//				val = reader[key];
//				ConsoleX.WriteLine("Field= \"" + key + "\", Value = " + val);
//				ConsoleX.WriteLine("Parsed as: " + reader.GetDateTimeValue(key).ToLongDateString());
//
//				key = "Text15";
//				val = reader[key];
//				ConsoleX.WriteLine("Field= \"" + key + "\", Value = " + val);
//				ConsoleX.WriteLine("Parsed as: " + reader.GetDateTimeValue(key).ToLongDateString());
				
				ConsoleX.WriteLine("Finished", ConsoleColor.Green);
				
				ConsoleX.WriteLine("Key to continue...");
				Console.ReadKey();
				
				reader = null;
			}
		}
Exemplo n.º 2
0
		private void OpenS82Reader(string fileName)
		{
			ConsoleX.WriteLine(string.Format("Reading '{0}' file...", fileName), ConsoleColor.Green);
			
			this.skipFile = false;
			this.CurrentReader = new S82Reader(fileName);
			
			if(this.CurrentReader.IsReadable)
			{
				this.ProcessVolunteer();
			}
			else
			{
				ConsoleX.WriteWarning("File is not readable. Perhaps it is not in the correct format.");
				ConsoleX.WriteLine("Press any key to continue.");
				Console.ReadKey();
				this.skipFile = true;
			}
			
			this.CurrentReader = null;
			
			if(this.skipFile)
			{
				ConsoleX.WriteLine(string.Format("Skipping '{0}'", fileName), ConsoleColor.Red);
				this.skippedFilesList.Add(fileName);
			}
			else
				ConsoleX.WriteLine(string.Format("Finished '{0}'", fileName), ConsoleColor.Green);
			
			ConsoleX.WriteHorizontalRule();
			
		}