GetData<T>
Get a saved value from the app domain and convert it back to its original type
Source
public static T GetData<T>(this AppDomain app, string name)
{
return (T)Convert.ChangeType(app.GetData(name), typeof(T));
}
Example
AppDomain.CurrentDomain.GetData<MyClass>("settings");