ResourceManager.GetStream Method (String, CultureInfo)

Returns an UnmanagedMemoryStream object from the specified resource, using the specified culture.

Namespace:  System.Resources
Assembly:  mscorlib (in mscorlib.dll)

public UnmanagedMemoryStream GetStream(
	string name,
	CultureInfo culture
)

Parameters

name
Type: System.String
The name of a resource.
culture
Type: System.Globalization.CultureInfo
The culture to use for the resource lookup. If culture is null, the culture for the current thread is used.

Return Value

Type: System.IO.UnmanagedMemoryStream
An unmanaged memory stream.

ExceptionCondition
InvalidOperationException

The value of the specified resource is not a MemoryStream object.

ArgumentNullException

name is null.

MissingManifestResourceException

No usable set of resources is found, and there are no neutral resources.

The GetStream method takes the name of a resource that is stored as a MemoryStream object, gets the value of the Object resource, and returns an UnmanagedMemoryStream object. The resource lookup is based on the culture specified by the culture parameter. If culture is null, the culture for the current thread is used.

This method is useful primarily for performance reasons: retrieving a resource as a UnmanagedMemoryStream object instead of an explicit object can improve performance.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2015 Microsoft