XFileManager.RegisterTemplates(Byte[]) Method (Microsoft.DirectX.Direct3D)
Registers custom templates.
Definition
Visual Basic Public Sub RegisterTemplates( _
ByVal data() As Byte _
)C# public void RegisterTemplates(
byte[] data
);C++ public:
void RegisterTemplates(
array<unsigned char>^ data
);JScript public function RegisterTemplates(
data : byte[]
);
Parameters
data System.Byte[]
Array of Byte values that contain the templates.
Remarks
The data parameter takes either a buffer that holds a compiled binary XFile, or a string that defines an XFile template, converted into an array of bytes. To convert a string into a byte array, use the GetBytes function, as in the following example, using stringVar as the string:
byte[] stringData = System.Text.Encoding.ASCII.GetBytes(stringVar);
The object should be disposed immediately when it is no longer needed.
Exceptions
- If a floating-point size is invalid, the GraphicsException.ErrorCode member contains the XFileErrorCodes.BadFileFloatSize enumerated value.
- If the file is not an XFile (.x file), GraphicsException.ErrorCode contains the XFileErrorCodes.BadFileType enumerated value.
- If the file version is not valid, GraphicsException.ErrorCode contains the XFileErrorCodes.BadFileVersion enumerated value.
- If a parameter is invalid, GraphicsException.ErrorCode contains the XFileErrorCodes.BadValue enumerated value.
- If the file could not be parsed, GraphicsException.ErrorCode contains the XFileErrorCodes.ParseError enumerated value.