/// <summary> /// Loads the specified type from the specified json stream /// </summary> /// <remarks> /// If your class name is MyNamespace.MyType, then this will attempt to load MyNamespace.MyType.json /// for the json definition in the same assembly. /// </remarks> /// <typeparam name="T">Type of object to load from the specified json</typeparam> /// <param name="stream">json content to load (e.g. from resources)</param> /// <param name="namespaceManager">Namespace manager to use when loading</param> /// <returns>A new instance of the specified type with the contents loaded from the json stream</returns> public static T Load <T> (Stream stream, NamespaceManager namespaceManager = null) where T : Widget, new() { return(Load <T> (stream, null, namespaceManager)); }
/// <summary> /// Loads the specified type from the specified json stream /// </summary> /// <remarks> /// If your class name is MyNamespace.MyType, then this will attempt to load MyNamespace.MyType.json /// for the json definition in the same assembly. /// </remarks> /// <typeparam name="T">Type of object to load from the specified json</typeparam> /// <param name="stream">json content to load (e.g. from resources)</param> /// <param name="namespaceManager">Namespace manager to use when loading</param> /// <returns>A new instance of the specified type with the contents loaded from the json stream</returns> public static T Load <T>(Stream stream, NamespaceManager namespaceManager = null) where T : new() { return(Load <T>(stream, default(T), namespaceManager)); }