Christian, Trust me, I've been saying the same thing myself. Below is the code. I commented the line where I verified the format was still dateTtime and then looked at the output that was put to the file in notepad to see that the format was now data time AM. Messed up my head something fierce.
public sealed class Serialize:IDisposable
{
static StreamWriter output;
//static FileStream output;
/// <summary>
/// Writes an opening Xml node to the stream
/// </summary>
/// <param name="fieldName"></param>
public static void WriteOpen(string fieldName)
{
string buffer = String.Format("<{0}>", fieldName);
//output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
output.Write( buffer );
}
/// <summary>
/// Writes a closing Xml node to the stream
/// </summary>
/// <param name="fieldName"></param>
public static void WriteClose(string fieldName)
{
string buffer = String.Format("</{0}>", fieldName);
//output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
output.Write( buffer );
}
/// <summary>
/// Writes a raw line of data to the stream
/// </summary>
/// <param name="rawData"></param>
public static void WriteRaw(string rawData)
{
//output.Write(Encoding.UTF8.GetBytes(rawData), 0, rawData.Length);
output.Write( rawData );
}
/// <summary>
/// Writes a formatted Xml line of data to the stream
/// </summary>
/// <param name="fieldName"></param>
/// <param name="value"></param>
public static void WriteLine(string fieldName, string value)
{
if (value.Length.Equals(0))
{
string buffer = String.Format("<{0} />", fieldName);
//output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
output.Write( buffer );
}
else
{
string buffer = String.Format("<{0}>{1}</{0}>", fieldName, value);
//output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
// THIS IS WHERE I BROKE THE CODE AND VERIFIED THE BUFFER DATA PASSED TO