Share via


XFileSaveObject.AddDataObject(Guid,String,Guid,Byte[]) Method (Microsoft.DirectX.Direct3D)

Adds a data object as a child of the XFileSaveData object.

Definition

Visual Basic Public Function AddDataObject( _
    ByVal guidTemplate As GuidLeave Site, _
    ByVal name As String, _
    ByVal guidData As GuidLeave Site, _
    ByVal data() As Byte _
) As XFileSaveData
C# public XFileSaveData AddDataObject(
    GuidLeave Site guidTemplate,
    string name,
    GuidLeave Site guidData,
    byte[] data
);
C++ public:
XFileSaveDataAddDataObject(
    GuidLeave Site guidTemplate,
    StringLeave Sitename,
    GuidLeave Site guidData,
    array<unsigned char>^ data
);
JScript public function AddDataObject(
    guidTemplate : GuidLeave Site,
    name : String,
    guidData : GuidLeave Site,
    data : byte[]
) : XFileSaveData;

Parameters

guidTemplate System.Guid
The globally unique identifier (GUID) representing the data object's template.
name System.String
The name of the data object. Specify null if the data object does not have a name.
guidData System.Guid
A GUID representing the data object. Specify null if the object does not have a GUID.
data System.Byte[]
A ByteLeave Site array as a buffer containing all required data in the data object.

Return Value

Microsoft.DirectX.Direct3D.XFileSaveData
An XFileSaveData object representing the file data node to which the data object will be added.

Remarks

If a data reference object will reference the data object, either the name or guidData parameter must be non-null.

Save the created data to disk by using the XFileSaveObject.Save method.

Exception GraphicsException.ErrorCode Cause
GraphicsException XFileErrorCodes.BadObject Data could not be read from or written to an object.
XFileErrorCodes.BadValue A variable is outside its expected range; typically returned when an object is invalid.
OutOfMemoryExceptionLeave Site N/A Microsoft Direct3D could not allocate sufficient memory to complete the call.