D
Daniel Moth
Hi
I was playing with the TimeZoneCollection and always got an
ArgumentException (emulator and CE device).. Turns out the value passed to
the DaylightName has loads of trailing nulls so the BlockCopy method throws
the exception... Inserting 1 line of code fixes it (for me anyway)...
public string DaylightName
set
{
value=value.TrimEnd(new char[]{(char)0});// FIXES ARGUMENT EXCEPTION
byte[] bytes = System.Text.Encoding.Unicode.GetBytes( value );
Buffer.BlockCopy(bytes, 0, flatStruct, daylightNameOffset, bytes.Length );
}
Cheers
Daniel
PS By the way, good work guys!
I was playing with the TimeZoneCollection and always got an
ArgumentException (emulator and CE device).. Turns out the value passed to
the DaylightName has loads of trailing nulls so the BlockCopy method throws
the exception... Inserting 1 line of code fixes it (for me anyway)...
public string DaylightName
set
{
value=value.TrimEnd(new char[]{(char)0});// FIXES ARGUMENT EXCEPTION
byte[] bytes = System.Text.Encoding.Unicode.GetBytes( value );
Buffer.BlockCopy(bytes, 0, flatStruct, daylightNameOffset, bytes.Length );
}
Cheers
Daniel
PS By the way, good work guys!