ExtensionMethod.NET Home of 875 C#, Visual Basic, F# and Javascript extension methods

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");

Author: Lee Hull

Submitted on: 6 jan 2012

Language: C#

Type: System.AppDomain

Views: 4377