internal static class AppSettings
Console.WriteLine("In constructor");
FileEncodingText = "UTF8";
private static string _fileEncodingText = "UTF8";
public static string FileEncodingText
get { return _fileEncodingText; }
Console.WriteLine("Setting value: " + value);
string oldValue = _fileEncodingText;
_fileEncodingText = value;
FileEncoding = Encoding.GetEncoding(value);
Console.WriteLine("Exception");
_fileEncodingText = oldValue;
FileEncoding = Encoding.UTF8;
public static Encoding FileEncoding { get; private set; }
public static void Main()
AppSettings.FileEncodingText = "UTF16";
Console.WriteLine(AppSettings.FileEncodingText);