Skip to main content
Version: 3.5

DataObject

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Implements a basic data transfer mechanism.

public class DataObject : IDataObject

Constructors

Instance memberDataObject()

Initializes a new instance of the DataObject class.

Instance memberDataObject(data)

Initializes a new instance of the DataObject class and adds the specified object to it.

NameTypeDescription
dataObjectThe data to store.

Instance memberDataObject(format, data)

Initializes a new instance of the DataObject class and adds the specified object in the specified format.

NameTypeDescription
formatStringThe format of the specified data. See DataFormats for predefined formats.
dataObjectThe data to store.

Instance memberDataObject(format, data)

Initializes a new instance of the DataObject class and adds the specified object in the specified format.

NameTypeDescription
formatTypeA Type representing the format of the data.
dataObjectThe data to store.

Methods

Instance memberContainsAudio()

Indicates whether the data object contains data in the WaveAudio format.

Returns: Boolean. true if the data object contains audio data; otherwise, false.

Instance memberContainsFileDropList()

Indicates whether the data object contains data that is in the FileDrop format or can be converted to that format.

Returns: Boolean. true if the data object contains a file drop list; otherwise, false.

Instance memberContainsImage()

Indicates whether the data object contains data that is in the Bitmap format or can be converted to that format.

Returns: Boolean. true if the data object contains image data; otherwise, false.

Instance memberContainsText()

Indicates whether the data object contains data in the UnicodeText format.

Returns: Boolean. true if the data object contains text data; otherwise, false.

Instance memberContainsText(format)

Indicates whether the data object contains text data in the format indicated by the specified TextDataFormat value.

ParameterTypeDescription
formatTextDataFormatOne of the TextDataFormat values.

Returns: Boolean. true if the data object contains text data in the specified format; otherwise, false.

Instance memberGetAudioStream()

Retrieves an audio stream from the data object.

Returns: Stream. A Stream containing audio data or null if the data object does not contain any data in the WaveAudio format.

Instance memberGetData(format)

Returns the data associated with the specified class type format.

ParameterTypeDescription
formatTypeA Type representing the format of the data to retrieve.

Returns: Object. The data associated with the specified format, or null.

Instance memberGetData(format)

Returns the data associated with the specified data format.

ParameterTypeDescription
formatStringThe format of the data to retrieve. See DataFormats for predefined formats.

Returns: Object. The data associated with the specified format, or null.

Instance memberGetData(format, autoConvert)

Returns the data associated with the specified data format, using an automated conversion parameter to determine whether to convert the data to the format.

ParameterTypeDescription
formatStringThe format of the data to retrieve. See DataFormats for predefined formats.
autoConvertBooleantrue to the convert data to the specified format; otherwise, false.

Returns: Object. The data associated with the specified format, or null.

Instance memberGetDataPresent(format)

Determines whether data stored in this DataObject is associated with, or can be converted to, the specified format.

ParameterTypeDescription
formatTypeA Type representing the format to check for.

Returns: Boolean. true if data stored in this DataObject is associated with, or can be converted to, the specified format; otherwise, false.

Instance memberGetDataPresent(format)

Returns the data associated with the specified class type format.

ParameterTypeDescription
formatStringA Type representing the format of the data to retrieve.

Returns: Boolean. The data associated with the specified format, or null.

Instance memberGetDataPresent(format, autoConvert)

Determines whether this DataObject contains data in the specified format or, optionally, contains data that can be converted to the specified format.

ParameterTypeDescription
formatStringThe format to check for. See DataFormats for predefined formats.
autoConvertBooleantrue to determine whether data stored in this DataObject can be converted to the specified format; false to check whether the data is in the specified format.

Returns: Boolean. true if the data is in, or can be converted to, the specified format; otherwise, false.

Instance memberGetFileDropList()

Returns the list of file types from the data object.

Returns: String[]. A string array containing the file types in the data object.

Instance memberGetFiles()

Returns the HttpFileCollection of files uploaded by the client in a drag & drop operation.

Returns: HttpFileCollection. A string array containing the file types in the data object.

Instance memberGetFormats()

Returns a list of all formats that data stored in this DataObject is associated with or can be converted to.

Returns: String[]. An array of type String, containing a list of all formats that are supported by the data stored in this object.

Instance memberGetFormats(autoConvert)

Returns a list of all formats that data stored in this DataObject is associated with or can be converted to, using an automatic conversion parameter to determine whether to retrieve only native data formats or all formats that the data can be converted to.

ParameterTypeDescription
autoConvertBooleantrue to retrieve all formats that data stored in this DataObject is associated with, or can be converted to; false to retrieve only native data formats.

Returns: String[]. An array of type String, containing a list of all formats that are supported by the data stored in this object.

Instance memberGetImage()

Retrieves an image from the data object.

Returns: Image. An Image representing the image data in the data object or null if the data object does not contain any data that is in the Bitmap format or can be converted to that format.

Instance memberGetText()

Retrieves text data from the data object in the UnicodeText format.

Returns: String. The text data in the data object or Empty if the data object does not contain data in the UnicodeText format.

Instance memberGetText(format)

Retrieves text data from the data object in the format indicated by the specified TextDataFormat value.

ParameterTypeDescription
formatTextDataFormatOne of the TextDataFormat values.

Returns: String. The text data in the data object or Empty if the data object does not contain data in the specified format.

Instance memberSetAudio(audioBytes)

Adds a Byte array to the data object in the WaveAudio format after converting it to a Stream.

ParameterTypeDescription
audioBytesByte[]A Byte array containing the audio data.

Throws:

Instance memberSetAudio(audioStream)

Adds a Stream to the data object in the WaveAudio format.

ParameterTypeDescription
audioStreamStreamA Stream containing the audio data.

Throws:

Instance memberSetData(data)

Adds the specified object to the DataObject using the object type as the data format.

ParameterTypeDescription
dataObjectThe data to store.

Instance memberSetData(format, data)

Adds the specified object to the DataObject using the specified type as the format.

ParameterTypeDescription
formatTypeA Type representing the format associated with the data.
dataObjectThe data to store.

Instance memberSetData(format, data)

Adds the specified object to the DataObject using the specified format.

ParameterTypeDescription
formatStringThe format associated with the data. See DataFormats for predefined formats.
dataObjectThe data to store.

Instance memberSetData(format, autoConvert, data)

Adds the specified object to the DataObject using the specified format and indicating whether the data can be converted to another format.

ParameterTypeDescription
formatStringThe format associated with the data. See DataFormats for predefined formats.
autoConvertBooleantrue to allow the data to be converted to another format; otherwise, false.
dataObjectThe data to store.

Instance memberSetDownloadURL(url, fileName)

Adds a url using DownloadURL format. The specified url is parsed to compose the DownloadURL as: "mime-type:file-name:url".

ParameterTypeDescription
urlStringThe url to the file to download.
fileNameStringThe name of the file to download from the url.

Instance memberSetFileDropList(filePaths)

Adds a collection of file names to the data object in the FileDrop format.

ParameterTypeDescription
filePathsStringCollectionA StringCollection containing the file names.

Throws:

Instance memberSetFileDropList(filePaths)

Adds a collection of file names to the data object in the FileDrop format.

ParameterTypeDescription
filePathsString[]A StringCollection containing the file names.

Throws:

Instance memberSetImage(image)

Adds an Image to the data object in the Bitmap format.

ParameterTypeDescription
imageImageThe Image to add to the data object.

Throws:

Instance memberSetText(textData)

Adds text data to the data object in the UnicodeText format.

ParameterTypeDescription
textDataStringThe text to add to the data object.

Throws:

Instance memberSetText(textData, format)

Adds text data to the data object in the format indicated by the specified TextDataFormat value.

ParameterTypeDescription
textDataStringThe text to add to the data object.
formatTextDataFormatOne of the TextDataFormat values.

Throws:

Implements

NameDescription
IDataObjectProvides a format-independent mechanism for transferring data.