[This is preliminary documentation and is subject to change.]
Pass a type and resource path rooted at type's namespace, for example
given
using (var stream = typeof(SomeType).GetBinary("My.Picture.gif")){...}
using (var stream = typeof(SomeType).GetBinary("My.Picture.gif")){...}
If "SomeType" is declared in "TestApp.Types", then statement's resource will have to be embedded under resource named:
"TestApp.Types.My.Picture.gif"
Namespace: NFXAssembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
public static byte[] GetBinaryContent(
this Type scopingType,
string resourceName
)
public static byte[] GetBinaryContent(
this Type scopingType,
string resourceName
)
<ExtensionAttribute>
Public Shared Function GetBinaryContent (
scopingType As Type,
resourceName As String
) As Byte()
<ExtensionAttribute>
Public Shared Function GetBinaryContent (
scopingType As Type,
resourceName As String
) As Byte()
public:
[ExtensionAttribute]
static array<unsigned char>^ GetBinaryContent(
Type^ scopingType,
String^ resourceName
)
public:
[ExtensionAttribute]
static array<unsigned char>^ GetBinaryContent(
Type^ scopingType,
String^ resourceName
)
static member GetBinaryContent :
scopingType : Type *
resourceName : string -> byte[]
static member GetBinaryContent :
scopingType : Type *
resourceName : string -> byte[]
Return Value
Type:
Byte Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).