Welcome to the Media Devices

Media Devices Documentation
Welcome to the Media Devices

Media Devices is a API to interact with MTP (Media Transfer Protocol) devices like cell phones, tablets and cameras.

Getting Started

To get started, add the MediaDevices package to your project.

  • Call MediaDevice.GetDevices() to get a list of all currently available MTP devices.

  • Call device.Connect() to connect to the MTP device.

Example:

C#
Copy
var devices = MediaDevice.GetDevices();
using (var device = devices.First(d => d.FriendlyName == "My Cell Phone"))
{
  device.Connect();

  device.CreateDirectory(@"\Phone\Documents\Temp");

  using(FileStream stream = File.OpenRead(@"C:/Temp/Test.txt"))
  {
    device.UploadFile(stream, @"\Phone\Documents\Temp\Test.txt");
  }
  device.Disconnect();
}

See the MediaDevices topics for more information.

Feel free to contact me if you need additional features or find bugs with your devices.

See Also

Other Resources

Version History


Version History

Version History

The topics in this section describe the various changes made to the Media Devices over the life of the project.

Version 1.2 was released on Nov. 20th, 2016.

  • Add GetFileInfo method

  • Add Cancel method

  • Add PnPDeviceID property

  • Add GetPrivateDevices method

Version 1.1 was released on Oct. 27th, 2016.

  • Add events

  • Add set friendly name

  • Add GetContentLocations

  • Add ResetDevice

  • Add SupportedCommands

  • Add SupportedContentTypes

  • Add SupportedEvents

Version 1.0 was released on Sep. 18th, 2016.

  • Creation

See Also

Other Resources

Welcome to the Media Devices


MediaDevices Namespace

MediaDevices Namespace
Namespace for Media Devices
Classes
 | Class | Description
Public class | MediaDevice | Represents a portable device.
Public class | MediaDeviceEventArgs | Event argument class for media device events
Public class | MediaFileInfo | Provides properties for files, directories and objects.
Public class | NotConnectedException | Represent error that occur if portable device is not connected.
Enumerations
 | Enumeration | Description
Public enumeration | Commands | Commands for the device
Public enumeration | ContentType | Supported content.
Public enumeration | DeviceTransport | device transports
Public enumeration | DeviceType | device types
Public enumeration | Events | Supported events
Public enumeration | FunctionalCategory | Functional categories
Public enumeration | MediaFileAttributes | Provides attributes for files, directories and objects.
Public enumeration | OperationState | Indicates the current state of the operation in progress.
Public enumeration | PowerSource | Power source of the device


Commands Enumeration

Commands Enumeration
Commands for the device

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public enum Commands
Public Enumeration Commands
public enum class Commands
type Commands
Members
Member name | Value | Description
Unknown | 0 | Unknown
ResetDevice | 1 | This command is sent by clients to reset the device.
GetObjectIdsFromPersistenUniqueIds | 2 | This command is sent when a client wants to get current ObjectIDs representing objects specified by previously acquired Persistent Unique IDs.
SaveClientInformation | 3 | This command is sent when a client first connects to a device.
GetContentLocation | 4 | This command is used to retrieve the ObjectIDs of folders that contain the specified content type
StorageFormat | 5 | This command will format the storage.
StorageEject | 6 | This will eject the storage, if it is a removable store and is capable of being ejected by the device.
SmsSend | 7 | This command is used to initiate the sending of an SMS message.
StillImageCaptureInitiate | 8 | Initiates a still image capture. This is processed as a single command i.e. there is no start or stop required.
ObjectEnumerationStartFind | 9 | The driver receives this command when a client wishes to start enumeration.
ObjectEnumerationFindNext | 10 | The driver receives this command when a client wishes to start enumeration.
ObjectEnumerationEndFind | 11 | The driver should destroy any resources associated with this enumeration context.
ObjectPropertiesGetSupported | 12 | This command is used when the client requests the list of properties supported by the specified object.
ObjectPropertiesGetAttribute | 13 | This command is used when the client requests the property attributes for the specified object properties.
ObjectPropertiesGet | 14 | This command is used when the client requests a set of property values for the specified object.
ObjectPropertiesSet | 15 | This command is used when the client requests to write a set of property values on the specified object.
ObjectPropertiesGetAll | 16 | This command is used when the client requests all property values for the specified object.
ObjectPropertiesDelete | 17 | This command is sent when the caller wants to delete properties from the specified object.
ObjectResourcesGetSupported | 18 | This command is sent when a client wants to get the list of resources supported on a particular object.
ObjectResourcesGetAttributes | 19 | This command is used when the client requests the attributes for the specified object resource.
ObjectResourcesOpen | 20 | Dependent on the value of WPD_PROPERTY_OBJECT_RESOURCES_ACCESS_MODE. STGM_READ will indicate FILE_READ_ACCESS for the command, anything else will indicate (FILE_READ_ACCESS | FILE_WRITE_ACCESS).
ObjectResourcesRead | 21 | This command is sent when a client wants to read the next band of data from a previously opened object resource.
ObjectResourcesWrite | 22 | This command is sent when a client wants to write the next band of data to a previously opened object resource.
ObjectResourcesClose | 23 | This command is sent when a client is finished transferring data to a previously opened object resource.
ObjectResourcesDelete | 24 | This command is sent when the client wants to delete the data associated with the specified resources from the specified object.
ObjectResourcesCreateResource | 25 | This command is sent when a client wants to create a new object resource on the device.
ObjectResourcesRevert | 26 | This command is sent when a client wants to cancel the resource creation request that is currently still in progress.
ObjectResourcesSeek | 27 | This command is sent when a client wants to seek to a specific offset in the data stream.
ObjectResourcesCommit | 28 | This command is sent when a client wants to commit changes to a data stream.
ObjectResourcesSeekInUnits | 29 | This command is sent when a client wants to seek to a specific offset in the data stream using alternate units.
CapabilitiesGetSupportedCommands | 30 | Return all commands supported by this driver. This includes custom commands, if any.
CapabilitiesGetCommandOptions | 31 | Returns the supported options for the specified command.
CapabilitiesGetSupportedFunctionalCategories | 32 | This command is used by clients to query the functional categories supported by the driver.
CapabilitiesGetFunctionalObjects | 33 | Retrieves the ObjectIDs of the objects belonging to the specified functional category.
CapabilitiesGetSupportedContentTypes | 34 | Retrieves the list of content types supported by this driver for the specified functional category.
CapabilitiesGetSupportedFormats | 35 | This command is used to query the possible formats supported by the specified content type (e.g. for image objects, the driver may choose to support JPEG and BMP files).
CapabilitiesGetSupportedFormatProperties | 36 | Get the list of properties that an object of the given format supports.
CapabilitiesGetFixedPropertyAttributes | 37 | Returns the property attributes that are the same for all objects of the given format.
CapabilitiesGetSupportedEvents | 38 | Return all events supported by this driver. This includes custom events, if any.
CapabilitiesGetEventOptions | 39 | Return extra information about a specified event, such as whether the event is for notification or action purposes.
ObjectManagementCreateObjectWithPropertiesOnly | 40 | This command is sent when a client wants to create a new object on the device, specified only by properties.
ObjectManagementCreateObjectWithPropertiesAndData | 41 | This command is sent when a client wants to create a new object on the device, specified by properties and data.
ObjectManagementWriteObjectData | 42 | This command is sent when a client wants to write the next band of data to a newly created object or an object being updated.
ObjectManagementCommitObject | 43 | This command is sent when a client has finished sending all the data associated with an object creation or update request, and wishes to ensure that the object is saved to the device.
ObjectManagementRevertObject | 44 | This command is sent when a client wants to cancel the object creation or update request that is currently still in progress.
ObjectManagementDeleteObjects | 45 | This command is sent when the client wishes to remove a set of objects from the device.
ObjectManagementMoveObjects | 46 | This command will move the specified objects to the destination folder.
ObjectManagementCopyObjects | 47 | This command will copy the specified objects to the destination folder.
ObjectManagementUpdateObjectsWithPropertiesAnsData | 48 | This command is sent when a client wants to update the object's data and dependent properties simultaneously.
ObjectPropertiesBulkGetValuesByObjectListStart | 49 | Initializes the operation to get the property values for all caller-specified objects.
ObjectPropertiesBulkGetValuesByObjectListNext | 50 | Get the next set of property values.
ObjectPropertiesBulkGetValuesByObjectListEnd | 51 | Ends the bulk property operation for getting property values by object list.
ObjectPropertiesBulkGetValuesByObjectFormatStart | 52 | Initializes the operation to get the property values for objects of the specified format
ObjectPropertiesBulkGetValuesByObjectFormatNext | 53 | Get the next set of property values.
ObjectPropertiesBulkGetValuesByObjectFormatEnd | 54 | Ends the bulk property operation for getting property values by object format.
ObjectPropertiesBulkSetValuesByObjectListStart | 55 | Initializes the operation to set the property values for specified objects.
ObjectPropertiesBulkSetValuesByObjectListNext | 56 | Set the next set of property values.
ObjectPropertiesBulkSetValuesByObjectListEnd | 57 | Ends the bulk property operation for setting property values by object list.
GenerateKeypair | 58 | Initiates the generation of a public/private key pair and returns the public key.
CommitKeypair | 59 | Commits a public/private key pair.
ProcessWirelessProfile | 60 | Initiates the processing of a Wireless Profile file.
See Also

Reference

MediaDevices Namespace


ContentType Enumeration

ContentType Enumeration
Supported content.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public enum ContentType
Public Enumeration ContentType
public enum class ContentType
type ContentType
Members
Member name | Value | Description
Unknown | 0 | Unknown
FunctionalObject | 1 | Indicates this object represents a functional object, not content data on the device.
Folder | 2 | Indicates this object is a folder.
Image | 3 | Indicates this object represents image data (e.g. a JPEG file)
Document | 4 | Indicates this object represents document data (e.g. a MS WORD file, TEXT file, etc.)
Contact | 5 | Indicates this object represents contact data (e.g. name/number, or a VCARD file)
ContactGroup | 6 | Indicates this object represents a group of contacts.
Audio | 7 | Indicates this object represents audio data (e.g. a WMA or MP3 file)
Video | 8 | Indicates this object represents video data (e.g. a WMV or AVI file)
Television | 9 | Indicates this object represents a television recording.
Playlist | 10 | Indicates this object represents a playlist.
MixedContentAlbum | 11 | Indicates this object represents an album, which may contain objects of different content types (typically, MUSIC, IMAGE and VIDEO).
AudioAlbum | 12 | Indicates this object represents an audio album.
ImageAlbum | 13 | Indicates this object represents an image album.
VideoAlbum | 14 | Indicates this object represents a video album.
Memo | 15 | Indicates this object represents memo data
EMail | 16 | Indicates this object represents e-mail data
Appointment | 17 | Indicates this object represents an appointment in a calendar
Task | 18 | Indicates this object represents a task for tracking (e.g. a TODO list)
Program | 19 | Indicates this object represents a file that can be run. This could be a script, executable and so on.
GenericFile | 20 | Indicates this object represents a file that does not fall into any of the other predefined WPD types for files.
Calendar | 21 | Indicates this object represents a calender
GenericMessage | 22 | Indicates this object represents a message (e.g. SMS message, E-Mail message, etc.)
NetworkAssociation | 23 | Indicates this object represents an association between a host and a device.
Certificate | 24 | Indicates this object represents certificate used for authentication.
WirelessProfile | 25 | Indicates this object represents wireless network access information.
MediaCast | 26 | Indicates this object represents a media cast. A media cast object can be though of as a container object that groups related content, similar to how a playlist groups songs to play. Often, a media cast object is used to group media content originally published online.
Section | 27 | Indicates this object describes a section of data contained in another object. The WPD_OBJECT_REFERENCES property indicates which object contains the actual data.
Unspecified | 28 | Indicates this object doesn't fall into the predefined WPD content types
All | 29 | This content type is only valid as a parameter to API functions and driver commands. It should not be reported as a supported content type by the driver.
See Also

Reference

MediaDevices Namespace


DeviceTransport Enumeration

DeviceTransport Enumeration
device transports

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public enum DeviceTransport
Public Enumeration DeviceTransport
public enum class DeviceTransport
type DeviceTransport
Members
Member name | Value | Description
NotSupported | -1 | not supportet by driver
Unspecified | 0 | unspecified transport
USB | 1 | USB transport
IP | 2 | IP transport
Bluetooth | 3 | bluetooth transport
See Also

Reference

MediaDevices Namespace


DeviceType Enumeration

DeviceType Enumeration
device types

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public enum DeviceType
Public Enumeration DeviceType
public enum class DeviceType
type DeviceType
Members
Member name | Value | Description
Generic | 0 | generic device type
Camera | 1 | camera device type
MediaPlayer | 2 | media player device type
Phone | 3 | phone device type
Video | 4 | video device type
PersonalInformationManager | 5 | personal information manager device type
AudioRecorder | 6 | audio recorderdevice type
See Also

Reference

MediaDevices Namespace


Events Enumeration

Events Enumeration
Supported events

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public enum Events
Public Enumeration Events
public enum class Events
type Events
Members
Member name | Value | Description
Unknown | 0 | Unknown
Notification | 1 | This GUID is used to identify all WPD driver events to the event sub-system. The driver uses this as the GUID identifier when it queues an event with IWdfDevice::PostEvent(). Applications never use this value.
ObjectAdded | 2 | This event is sent after a new object is available on the device.
ObjectRemoved | 3 | This event is sent after a previously existing object has been removed from the device.
ObjectUpdated | 4 | This event is sent after an object has been updated such that any connected client should refresh its view of that object.
DeviceReset | 5 | This event indicates that the device is about to be reset, and all connected clients should close their connection to the device.
DeviceCapabilitiesUpdated | 6 | This event indicates that the device capabilities have changed. Clients should re-query the device if they have made any decisions based on device capabilities.
StorageFormat | 7 | This event indicates the progress of a format operation on a storage object.
ObjectTransferRequest | 8 | This event is sent to request an application to transfer a particular object from the device.
DeviceRemoved | 9 | This event is sent when a driver for a device is being unloaded. This is typically a result of the device being unplugged.
ServiceMethodComplete | 10 | This event is sent when a driver has completed invoking a service method. This event must be sent even when the method fails.
See Also

Reference

MediaDevices Namespace


FunctionalCategory Enumeration

FunctionalCategory Enumeration
Functional categories

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public enum FunctionalCategory
Public Enumeration FunctionalCategory
public enum class FunctionalCategory
type FunctionalCategory
Members
Member name | Value | Description
Unknown | 0 | Unknown
Device | 1 | Used for the device object, which is always the top-most object of the device.
Storage | 2 | Indicates this object encapsulates storage functionality on the device (e.g. memory cards, internal memory)
StillImageCapture | 3 | Indicates this object encapsulates still image capture functionality on the device (e.g. camera or camera attachment)
AudioCapture | 4 | Indicates this object encapsulates audio capture functionality on the device (e.g. voice recorder or other audio recording component)
VideoCapture | 5 | Indicates this object encapsulates video capture functionality on the device (e.g. video recorder or video recording component)
SMS | 6 | Indicates this object encapsulates SMS sending functionality on the device (not the receiving or saved SMS messages since those are represented as content objects on the device)
RenderingInformation | 7 | Indicates this object provides information about the rendering characteristics of the device.
NetworkConfiguration | 8 | Indicates this object encapsulates network configuration functionality on the device (e.g. WiFi Profiles, Partnerships).
All | 9 | This functional category is only valid as a parameter to API functions and driver commands. It should not be reported as a supported functional category by the driver.
See Also

Reference

MediaDevices Namespace


MediaDevice Class

MediaDevice Class
Represents a portable device.
Inheritance Hierarchy
SystemObject
MediaDevicesMediaDevice

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public sealed class MediaDevice : IDisposable
Public NotInheritable Class MediaDevice
    Implements IDisposable
public ref class MediaDevice sealed : IDisposable
[<SealedAttribute>]
type MediaDevice =
    class
        interface IDisposable
    end

The MediaDevice type exposes the following members.

Properties
 | Name | Description
Public property | Description | Description of the portable device.
Public property | DeviceId | Device Id of the portable device.
Public property | DeviceType | Device type of the portable device.
Public property | FirmwareVersion | Firmware version of the portable device.
Public property | FriendlyName | Friendly name of the portable device.
Public property | IsConnected | Is portable device connected.
Public property | Manufacture | Manufacture of the portable device.
Public property | Manufacturer | Manufacturer of the device.
Public property | Model | Model of the portable device.
Public property | PnPDeviceID | PnP device ID
Public property | PowerLevel | Battery level of the portable device.
Public property | PowerSource | Power source of the device.
Public property | Protocol | Protocol of the device.
Public property | SerialNumber | Serial number of the portable device.
Public property | SupportedFormatsAreOrdered | Supported formats are ordered.
Public property | SupportsNonConsumable | Supports non consumable.
Public property | SyncPartner | Sync partner of the device.
Public property | Transport | Device transport.
Top
Methods
 | Name | Description
Public method | Cancel | The Cancel method cancels a pending operation on this device.
Public method | Connect | Connect to the portable device.
Public method | CreateDirectory | Creates all directories and subdirectories in the specified path.
Public method | DeleteDirectory | Deletes the specified directory and, if indicated, any subdirectories and files in the directory.
Public method | DeleteFile | Deletes the specified file.
Public method | DirectoryExists | Determines whether the given path refers to an existing directory on disk.
Public method | Disconnect | Disconnect from the portable device.
Public method | Dispose | Releases the resources used by the PortableDevices.PortableDevice.
Public method | DownloadFile | Download data from a file on a portable device to a stream.
Public method | EjectStorage | Eject storage
Public method | EnumerateDirectories | Returns an enumerable collection of directory names in a specified path.
Public method | EnumerateFiles | Returns an enumerable collection of file names in a specified path.
Public method | EnumerateFileSystemEntries | Returns an enumerable collection of file-system entries in a specified path.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | FileExists | Determines whether the specified file exists.
Public method | FormatStorage | Format storage
Public method | GetContentLocations | Get content locations
 | GetDevices | Returns an enumerable collection of currently available portable devices.
Public method | GetFileInfo | Gets a new instance of the MediaFileInfo class, which acts as a wrapper for a file path.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
 | GetPrivateDevices | Returns an enumerable collection of currently available private portable devices.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ResetDevice | Reset device
Public method | SupportedCommands | Retrieves all commands supported by the device.
Public method | SupportedContentTypes | Get supported content types
Public method | SupportedEvents | Retrieves all events supported by the device.
Public method | ToString | Overrides ToString for debug use. (Overrides ObjectToString.)
Public method | UploadFile | Upload data from a stream to a file on a portable device.
Top
Events
 | Name | Description
Public event | DeviceCapabilitiesUpdated | This event indicates that the device capabilities have changed. Clients should re-query the device if they have made any decisions based on device capabilities.
Public event | DeviceRemoved | This event is sent when a driver for a device is being unloaded. This is typically a result of the device being unplugged.
Public event | DeviceReset | This event indicates that the device is about to be reset, and all connected clients should close their connection to the device.
Public event | ObjectAdded | This event is sent after a new object is available on the device.
Public event | ObjectRemoved | This event is sent after a previously existing object has been removed from the device.
Public event | ObjectTransferRequest | This event is sent to request an application to transfer a particular object from the device.
Public event | ObjectUpdated | This event is sent after an object has been updated such that any connected client should refresh its view of that object.
Public event | ServiceMethodComplete | This event is sent when a driver has completed invoking a service method. This event must be sent even when the method fails.
Public event | StorageFormat | This event indicates the progress of a format operation on a storage object.
Top
See Also

Reference

MediaDevices Namespace


MediaDevice Properties

MediaDevice Properties

The MediaDevice type exposes the following members.

Properties
 | Name | Description
Public property | Description | Description of the portable device.
Public property | DeviceId | Device Id of the portable device.
Public property | DeviceType | Device type of the portable device.
Public property | FirmwareVersion | Firmware version of the portable device.
Public property | FriendlyName | Friendly name of the portable device.
Public property | IsConnected | Is portable device connected.
Public property | Manufacture | Manufacture of the portable device.
Public property | Manufacturer | Manufacturer of the device.
Public property | Model | Model of the portable device.
Public property | PnPDeviceID | PnP device ID
Public property | PowerLevel | Battery level of the portable device.
Public property | PowerSource | Power source of the device.
Public property | Protocol | Protocol of the device.
Public property | SerialNumber | Serial number of the portable device.
Public property | SupportedFormatsAreOrdered | Supported formats are ordered.
Public property | SupportsNonConsumable | Supports non consumable.
Public property | SyncPartner | Sync partner of the device.
Public property | Transport | Device transport.
Top
See Also

Reference

MediaDevice Class


MediaDevice.Description Property

MediaDeviceDescription Property
Description of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string Description { get; }
Public ReadOnly Property Description As String
    Get
public:
property String^ Description {
    String^ get ();
}
member Description : string with get

Property Value

Type: String
Remarks
Readable when not connected.
See Also

Reference


MediaDevice.DeviceId Property

MediaDeviceDeviceId Property
Device Id of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string DeviceId { get; }
Public ReadOnly Property DeviceId As String
    Get
public:
property String^ DeviceId {
    String^ get ();
}
member DeviceId : string with get

Property Value

Type: String
Remarks
Readable when not connected.
See Also

Reference


MediaDevice.DeviceType Property

MediaDeviceDeviceType Property
Device type of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public DeviceType DeviceType { get; }
Public ReadOnly Property DeviceType As DeviceType
    Get
public:
property DeviceType DeviceType {
    DeviceType get ();
}
member DeviceType : DeviceType with get

Property Value

Type: DeviceType
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.FirmwareVersion Property

MediaDeviceFirmwareVersion Property
Firmware version of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string FirmwareVersion { get; }
Public ReadOnly Property FirmwareVersion As String
    Get
public:
property String^ FirmwareVersion {
    String^ get ();
}
member FirmwareVersion : string with get

Property Value

Type: String
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.FriendlyName Property

MediaDeviceFriendlyName Property
Friendly name of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string FriendlyName { get; set; }
Public Property FriendlyName As String
    Get
    Set
public:
property String^ FriendlyName {
    String^ get ();
    void set (String^ value);
}
member FriendlyName : string with get, set

Property Value

Type: String
Exceptions
Exception | Condition
NotConnectedException | device is not connected. only for setter
Remarks
Readable when not connected.
See Also

Reference


MediaDevice.IsConnected Property

MediaDeviceIsConnected Property
Is portable device connected.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public bool IsConnected { get; }
Public ReadOnly Property IsConnected As Boolean
    Get
public:
property bool IsConnected {
    bool get ();
}
member IsConnected : bool with get

Property Value

Type: Boolean
See Also

Reference


MediaDevice.Manufacture Property

MediaDeviceManufacture Property
Manufacture of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string Manufacture { get; }
Public ReadOnly Property Manufacture As String
    Get
public:
property String^ Manufacture {
    String^ get ();
}
member Manufacture : string with get

Property Value

Type: String
Remarks
Readable when not connected.
See Also

Reference


MediaDevice.Manufacturer Property

MediaDeviceManufacturer Property
Manufacturer of the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string Manufacturer { get; }
Public ReadOnly Property Manufacturer As String
    Get
public:
property String^ Manufacturer {
    String^ get ();
}
member Manufacturer : string with get

Property Value

Type: String
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.Model Property

MediaDeviceModel Property
Model of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string Model { get; }
Public ReadOnly Property Model As String
    Get
public:
property String^ Model {
    String^ get ();
}
member Model : string with get

Property Value

Type: String
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.PnPDeviceID Property

MediaDevicePnPDeviceID Property
PnP device ID

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string PnPDeviceID { get; }
Public ReadOnly Property PnPDeviceID As String
    Get
public:
property String^ PnPDeviceID {
    String^ get ();
}
member PnPDeviceID : string with get

Property Value

Type: String
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.PowerLevel Property

MediaDevicePowerLevel Property
Battery level of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public int PowerLevel { get; }
Public ReadOnly Property PowerLevel As Integer
    Get
public:
property int PowerLevel {
    int get ();
}
member PowerLevel : int with get

Property Value

Type: Int32
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.PowerSource Property

MediaDevicePowerSource Property
Power source of the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public PowerSource PowerSource { get; }
Public ReadOnly Property PowerSource As PowerSource
    Get
public:
property PowerSource PowerSource {
    PowerSource get ();
}
member PowerSource : PowerSource with get

Property Value

Type: PowerSource
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.Protocol Property

MediaDeviceProtocol Property
Protocol of the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string Protocol { get; }
Public ReadOnly Property Protocol As String
    Get
public:
property String^ Protocol {
    String^ get ();
}
member Protocol : string with get

Property Value

Type: String
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.SerialNumber Property

MediaDeviceSerialNumber Property
Serial number of the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string SerialNumber { get; }
Public ReadOnly Property SerialNumber As String
    Get
public:
property String^ SerialNumber {
    String^ get ();
}
member SerialNumber : string with get

Property Value

Type: String
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.SupportedFormatsAreOrdered Property

MediaDeviceSupportedFormatsAreOrdered Property
Supported formats are ordered.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public bool SupportedFormatsAreOrdered { get; }
Public ReadOnly Property SupportedFormatsAreOrdered As Boolean
    Get
public:
property bool SupportedFormatsAreOrdered {
    bool get ();
}
member SupportedFormatsAreOrdered : bool with get

Property Value

Type: Boolean
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.SupportsNonConsumable Property

MediaDeviceSupportsNonConsumable Property
Supports non consumable.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public bool SupportsNonConsumable { get; }
Public ReadOnly Property SupportsNonConsumable As Boolean
    Get
public:
property bool SupportsNonConsumable {
    bool get ();
}
member SupportsNonConsumable : bool with get

Property Value

Type: Boolean
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.SyncPartner Property

MediaDeviceSyncPartner Property
Sync partner of the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string SyncPartner { get; }
Public ReadOnly Property SyncPartner As String
    Get
public:
property String^ SyncPartner {
    String^ get ();
}
member SyncPartner : string with get

Property Value

Type: String
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.Transport Property

MediaDeviceTransport Property
Device transport.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public DeviceTransport Transport { get; }
Public ReadOnly Property Transport As DeviceTransport
    Get
public:
property DeviceTransport Transport {
    DeviceTransport get ();
}
member Transport : DeviceTransport with get

Property Value

Type: DeviceTransport
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice Methods

MediaDevice Methods

The MediaDevice type exposes the following members.

Methods
 | Name | Description
Public method | Cancel | The Cancel method cancels a pending operation on this device.
Public method | Connect | Connect to the portable device.
Public method | CreateDirectory | Creates all directories and subdirectories in the specified path.
Public method | DeleteDirectory | Deletes the specified directory and, if indicated, any subdirectories and files in the directory.
Public method | DeleteFile | Deletes the specified file.
Public method | DirectoryExists | Determines whether the given path refers to an existing directory on disk.
Public method | Disconnect | Disconnect from the portable device.
Public method | Dispose | Releases the resources used by the PortableDevices.PortableDevice.
Public method | DownloadFile | Download data from a file on a portable device to a stream.
Public method | EjectStorage | Eject storage
Public method | EnumerateDirectories | Returns an enumerable collection of directory names in a specified path.
Public method | EnumerateFiles | Returns an enumerable collection of file names in a specified path.
Public method | EnumerateFileSystemEntries | Returns an enumerable collection of file-system entries in a specified path.
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | FileExists | Determines whether the specified file exists.
Public method | FormatStorage | Format storage
Public method | GetContentLocations | Get content locations
 | GetDevices | Returns an enumerable collection of currently available portable devices.
Public method | GetFileInfo | Gets a new instance of the MediaFileInfo class, which acts as a wrapper for a file path.
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
 | GetPrivateDevices | Returns an enumerable collection of currently available private portable devices.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ResetDevice | Reset device
Public method | SupportedCommands | Retrieves all commands supported by the device.
Public method | SupportedContentTypes | Get supported content types
Public method | SupportedEvents | Retrieves all events supported by the device.
Public method | ToString | Overrides ToString for debug use. (Overrides ObjectToString.)
Public method | UploadFile | Upload data from a stream to a file on a portable device.
Top
See Also

Reference


MediaDevice.Cancel Method

MediaDeviceCancel Method
The Cancel method cancels a pending operation on this device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void Cancel()
Public Sub Cancel
public:
void Cancel()
member Cancel : unit -> unit
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.Connect Method

MediaDeviceConnect Method
Connect to the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void Connect()
Public Sub Connect
public:
void Connect()
member Connect : unit -> unit
See Also

Reference


MediaDevice.CreateDirectory Method

MediaDeviceCreateDirectory Method
Creates all directories and subdirectories in the specified path.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void CreateDirectory(
    string path
)
Public Sub CreateDirectory (
    path As String
)
public:
void CreateDirectory(
    String^ path
)
member CreateDirectory :
        path : string -> unit

Parameters

path
Type: SystemString
The directory path to create.
Exceptions
Exception | Condition
IOException | path is a file name.
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
DirectoryNotFoundException | path is invalid.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.DeleteDirectory Method

MediaDeviceDeleteDirectory Method
Deletes the specified directory and, if indicated, any subdirectories and files in the directory.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void DeleteDirectory(
    string path,
    bool recursive = false
)
Public Sub DeleteDirectory (
    path As String,
    Optional recursive As Boolean = false
)
public:
void DeleteDirectory(
    String^ path,
    bool recursive = false
)
member DeleteDirectory :
        path : string *
        ?recursive : bool
(* Defaults:
        let _recursive = defaultArg recursive false
*)
-> unit

Parameters

path
Type: SystemString
The name of the directory to remove.
recursive (Optional)
Type: SystemBoolean
true to remove directories, subdirectories, and files in path; otherwise, false.
Exceptions
Exception | Condition
IOException | path is a file name.
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
DirectoryNotFoundException | path is invalid.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.DeleteFile Method

MediaDeviceDeleteFile Method
Deletes the specified file.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void DeleteFile(
    string path
)
Public Sub DeleteFile (
    path As String
)
public:
void DeleteFile(
    String^ path
)
member DeleteFile :
        path : string -> unit

Parameters

path
Type: SystemString
The name of the file to be deleted. Wildcard characters are not supported.
Exceptions
Exception | Condition
IOException | path is a file name.
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
DirectoryNotFoundException | path is invalid.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.DirectoryExists Method

MediaDeviceDirectoryExists Method
Determines whether the given path refers to an existing directory on disk.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public bool DirectoryExists(
    string path
)
Public Function DirectoryExists (
    path As String
) As Boolean
public:
bool DirectoryExists(
    String^ path
)
member DirectoryExists :
        path : string -> bool

Parameters

path
Type: SystemString
The path to test.

Return Value

Type: Boolean
true if path refers to an existing directory; otherwise, false.
Exceptions
Exception | Condition
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.Disconnect Method

MediaDeviceDisconnect Method
Disconnect from the portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void Disconnect()
Public Sub Disconnect
public:
void Disconnect()
member Disconnect : unit -> unit
See Also

Reference


MediaDevice.Dispose Method

MediaDeviceDispose Method
Releases the resources used by the PortableDevices.PortableDevice.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void Dispose()
Public Sub Dispose
public:
virtual void Dispose() sealed
abstract Dispose : unit -> unit
override Dispose : unit -> unit

Implements

IDisposableDispose
See Also

Reference


MediaDevice.DownloadFile Method

MediaDeviceDownloadFile Method
Download data from a file on a portable device to a stream.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void DownloadFile(
    string path,
    Stream stream
)
Public Sub DownloadFile (
    path As String,
    stream As Stream
)
public:
void DownloadFile(
    String^ path,
    Stream^ stream
)
member DownloadFile :
        path : string *
        stream : Stream -> unit

Parameters

path
Type: SystemString
The path to the file.
stream
Type: System.IOStream
The stream to download to.
Exceptions
Exception | Condition
IOException | path is a file name.
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
DirectoryNotFoundException | path is invalid.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.EjectStorage Method

MediaDeviceEjectStorage Method
Eject storage

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void EjectStorage(
    string path
)
Public Sub EjectStorage (
    path As String
)
public:
void EjectStorage(
    String^ path
)
member EjectStorage :
        path : string -> unit

Parameters

path
Type: SystemString
Path of storage to eject.
See Also

Reference


MediaDevice.EnumerateDirectories Method

MediaDeviceEnumerateDirectories Method
Returns an enumerable collection of directory names in a specified path.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public IEnumerable<string> EnumerateDirectories(
    string path
)
Public Function EnumerateDirectories (
    path As String
) As IEnumerable(Of String)
public:
IEnumerable<String^>^ EnumerateDirectories(
    String^ path
)
member EnumerateDirectories :
        path : string -> IEnumerable<string>

Parameters

path
Type: SystemString
The directory to search.

Return Value

Type: IEnumerable String
An enumerable collection of directory names in the directory specified by path.
Exceptions
Exception | Condition
IOException | path is a file name.
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
DirectoryNotFoundException | path is invalid.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.EnumerateFiles Method

MediaDeviceEnumerateFiles Method
Returns an enumerable collection of file names in a specified path.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public IEnumerable<string> EnumerateFiles(
    string path
)
Public Function EnumerateFiles (
    path As String
) As IEnumerable(Of String)
public:
IEnumerable<String^>^ EnumerateFiles(
    String^ path
)
member EnumerateFiles :
        path : string -> IEnumerable<string>

Parameters

path
Type: SystemString
The directory to search.

Return Value

Type: IEnumerable String
An enumerable collection of file names in the directory specified by path.
Exceptions
Exception | Condition
IOException | path is a file name.
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
DirectoryNotFoundException | path is invalid.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.EnumerateFileSystemEntries Method

MediaDeviceEnumerateFileSystemEntries Method
Returns an enumerable collection of file-system entries in a specified path.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public IEnumerable<string> EnumerateFileSystemEntries(
    string path
)
Public Function EnumerateFileSystemEntries (
    path As String
) As IEnumerable(Of String)
public:
IEnumerable<String^>^ EnumerateFileSystemEntries(
    String^ path
)
member EnumerateFileSystemEntries :
        path : string -> IEnumerable<string>

Parameters

path
Type: SystemString
The directory to search.

Return Value

Type: IEnumerable String
An enumerable collection of file-system entries in the directory specified by path.
Exceptions
Exception | Condition
IOException | path is a file name.
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
DirectoryNotFoundException | path is invalid.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.FileExists Method

MediaDeviceFileExists Method
Determines whether the specified file exists.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public bool FileExists(
    string path
)
Public Function FileExists (
    path As String
) As Boolean
public:
bool FileExists(
    String^ path
)
member FileExists :
        path : string -> bool

Parameters

path
Type: SystemString
The file to check.

Return Value

Type: Boolean
true if the path contains the name of an existing file; otherwise, false.
Exceptions
Exception | Condition
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.FormatStorage Method

MediaDeviceFormatStorage Method
Format storage

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void FormatStorage(
    string path
)
Public Sub FormatStorage (
    path As String
)
public:
void FormatStorage(
    String^ path
)
member FormatStorage :
        path : string -> unit

Parameters

path
Type: SystemString
Path of storage to format.
See Also

Reference


MediaDevice.GetContentLocations Method

MediaDeviceGetContentLocations Method
Get content locations

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public IEnumerable<string> GetContentLocations(
    ContentType contentType
)
Public Function GetContentLocations (
    contentType As ContentType
) As IEnumerable(Of String)
public:
IEnumerable<String^>^ GetContentLocations(
    ContentType contentType
)
member GetContentLocations :
        contentType : ContentType -> IEnumerable<string>

Parameters

contentType
Type: MediaDevicesContentType
Content type to find the locations for.

Return Value

Type: IEnumerable String
List with the location pathes.
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.GetDevices Method

MediaDeviceGetDevices Method
Returns an enumerable collection of currently available portable devices.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public static IEnumerable<MediaDevice> GetDevices()
Public Shared Function GetDevices As IEnumerable(Of MediaDevice)
public:
static IEnumerable<MediaDevice^>^ GetDevices()
static member GetDevices : unit -> IEnumerable<MediaDevice>

Return Value

Type: IEnumerable MediaDevice
>An enumerable collection of portable devices currently available.
See Also

Reference


MediaDevice.GetFileInfo Method

MediaDeviceGetFileInfo Method
Gets a new instance of the MediaFileInfo class, which acts as a wrapper for a file path.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public MediaFileInfo GetFileInfo(
    string path
)
Public Function GetFileInfo (
    path As String
) As MediaFileInfo
public:
MediaFileInfo^ GetFileInfo(
    String^ path
)
member GetFileInfo :
        path : string -> MediaFileInfo

Parameters

path
Type: SystemString
The fully qualified name of the file, directory or object.

Return Value

Type: MediaFileInfo
New instance of the MediaFileInfo class
See Also

Reference


MediaDevice.GetPrivateDevices Method

MediaDeviceGetPrivateDevices Method
Returns an enumerable collection of currently available private portable devices.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public static IEnumerable<MediaDevice> GetPrivateDevices()
Public Shared Function GetPrivateDevices As IEnumerable(Of MediaDevice)
public:
static IEnumerable<MediaDevice^>^ GetPrivateDevices()
static member GetPrivateDevices : unit -> IEnumerable<MediaDevice>

Return Value

Type: IEnumerable MediaDevice
>An enumerable collection of private portable devices currently available.
See Also

Reference


MediaDevice.ResetDevice Method

MediaDeviceResetDevice Method
Reset device

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void ResetDevice()
Public Sub ResetDevice
public:
void ResetDevice()
member ResetDevice : unit -> unit
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
NotSupportedException | not supported by device.
See Also

Reference


MediaDevice.SupportedCommands Method

MediaDeviceSupportedCommands Method
Retrieves all commands supported by the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public IEnumerable<Commands> SupportedCommands()
Public Function SupportedCommands As IEnumerable(Of Commands)
public:
IEnumerable<Commands>^ SupportedCommands()
member SupportedCommands : unit -> IEnumerable<Commands>

Return Value

Type: IEnumerable Commands
List with supported commands
See Also

Reference


MediaDevice.SupportedContentTypes Method

MediaDeviceSupportedContentTypes Method
Get supported content types

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public IEnumerable<ContentType> SupportedContentTypes(
    FunctionalCategory functionalCategory
)
Public Function SupportedContentTypes (
    functionalCategory As FunctionalCategory
) As IEnumerable(Of ContentType)
public:
IEnumerable<ContentType>^ SupportedContentTypes(
    FunctionalCategory functionalCategory
)
member SupportedContentTypes :
        functionalCategory : FunctionalCategory -> IEnumerable<ContentType>

Parameters

functionalCategory
Type: MediaDevicesFunctionalCategory
Select functional category

Return Value

Type: IEnumerable ContentType
List with supported content types
Exceptions
Exception | Condition
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice.SupportedEvents Method

MediaDeviceSupportedEvents Method
Retrieves all events supported by the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public IEnumerable<Events> SupportedEvents()
Public Function SupportedEvents As IEnumerable(Of Events)
public:
IEnumerable<Events>^ SupportedEvents()
member SupportedEvents : unit -> IEnumerable<Events>

Return Value

Type: IEnumerable Events
List with supported events
See Also

Reference


MediaDevice.ToString Method

MediaDeviceToString Method
Overrides ToString for debug use.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public override string ToString()
Public Overrides Function ToString As String
public:
virtual String^ ToString() override
abstract ToString : unit -> string
override ToString : unit -> string

Return Value

Type: String
A string with the friendly name, the manufacture and the description.
See Also

Reference


MediaDevice.UploadFile Method

MediaDeviceUploadFile Method
Upload data from a stream to a file on a portable device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public void UploadFile(
    Stream stream,
    string path
)
Public Sub UploadFile (
    stream As Stream,
    path As String
)
public:
void UploadFile(
    Stream^ stream,
    String^ path
)
member UploadFile :
        stream : Stream *
        path : string -> unit

Parameters

stream
Type: System.IOStream
The stream to upload from.
path
Type: SystemString
The path to the file.
Exceptions
Exception | Condition
IOException | path is a file name.
ArgumentException | path is a zero-length string, contains only white space, or contains invalid characters as defined by System.IO.Path.GetInvalidPathChars.
ArgumentNullException | path is null.
DirectoryNotFoundException | path is invalid.
NotConnectedException | device is not connected.
See Also

Reference


MediaDevice Events

MediaDevice Events

The MediaDevice type exposes the following members.

Events
 | Name | Description
Public event | DeviceCapabilitiesUpdated | This event indicates that the device capabilities have changed. Clients should re-query the device if they have made any decisions based on device capabilities.
Public event | DeviceRemoved | This event is sent when a driver for a device is being unloaded. This is typically a result of the device being unplugged.
Public event | DeviceReset | This event indicates that the device is about to be reset, and all connected clients should close their connection to the device.
Public event | ObjectAdded | This event is sent after a new object is available on the device.
Public event | ObjectRemoved | This event is sent after a previously existing object has been removed from the device.
Public event | ObjectTransferRequest | This event is sent to request an application to transfer a particular object from the device.
Public event | ObjectUpdated | This event is sent after an object has been updated such that any connected client should refresh its view of that object.
Public event | ServiceMethodComplete | This event is sent when a driver has completed invoking a service method. This event must be sent even when the method fails.
Public event | StorageFormat | This event indicates the progress of a format operation on a storage object.
Top
See Also

Reference


MediaDevice.DeviceCapabilitiesUpdated Event

MediaDeviceDeviceCapabilitiesUpdated Event
This event indicates that the device capabilities have changed. Clients should re-query the device if they have made any decisions based on device capabilities.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> DeviceCapabilitiesUpdated
Public Event DeviceCapabilitiesUpdated As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ DeviceCapabilitiesUpdated {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member DeviceCapabilitiesUpdated : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDevice.DeviceRemoved Event

MediaDeviceDeviceRemoved Event
This event is sent when a driver for a device is being unloaded. This is typically a result of the device being unplugged.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> DeviceRemoved
Public Event DeviceRemoved As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ DeviceRemoved {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member DeviceRemoved : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDevice.DeviceReset Event

MediaDeviceDeviceReset Event
This event indicates that the device is about to be reset, and all connected clients should close their connection to the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> DeviceReset
Public Event DeviceReset As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ DeviceReset {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member DeviceReset : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDevice.ObjectAdded Event

MediaDeviceObjectAdded Event
This event is sent after a new object is available on the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> ObjectAdded
Public Event ObjectAdded As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ ObjectAdded {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member ObjectAdded : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDevice.ObjectRemoved Event

MediaDeviceObjectRemoved Event
This event is sent after a previously existing object has been removed from the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> ObjectRemoved
Public Event ObjectRemoved As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ ObjectRemoved {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member ObjectRemoved : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDevice.ObjectTransferRequest Event

MediaDeviceObjectTransferRequest Event
This event is sent to request an application to transfer a particular object from the device.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> ObjectTransferRequest
Public Event ObjectTransferRequest As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ ObjectTransferRequest {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member ObjectTransferRequest : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDevice.ObjectUpdated Event

MediaDeviceObjectUpdated Event
This event is sent after an object has been updated such that any connected client should refresh its view of that object.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> ObjectUpdated
Public Event ObjectUpdated As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ ObjectUpdated {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member ObjectUpdated : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDevice.ServiceMethodComplete Event

MediaDeviceServiceMethodComplete Event
This event is sent when a driver has completed invoking a service method. This event must be sent even when the method fails.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> ServiceMethodComplete
Public Event ServiceMethodComplete As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ ServiceMethodComplete {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member ServiceMethodComplete : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDevice.StorageFormat Event

MediaDeviceStorageFormat Event
This event indicates the progress of a format operation on a storage object.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public event EventHandler<MediaDeviceEventArgs> StorageFormat
Public Event StorageFormat As EventHandler(Of MediaDeviceEventArgs)
public:
 event EventHandler<MediaDeviceEventArgs^>^ StorageFormat {
    void add (EventHandler<MediaDeviceEventArgs^>^ value);
    void remove (EventHandler<MediaDeviceEventArgs^>^ value);
}
member StorageFormat : IEvent<EventHandler<MediaDeviceEventArgs>,
    MediaDeviceEventArgs>

Value

Type: SystemEventHandler MediaDeviceEventArgs
See Also

Reference


MediaDeviceEventArgs Class

MediaDeviceEventArgs Class
Event argument class for media device events
Inheritance Hierarchy
SystemObject
SystemEventArgs
MediaDevicesMediaDeviceEventArgs

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public class MediaDeviceEventArgs : EventArgs
Public Class MediaDeviceEventArgs
    Inherits EventArgs
public ref class MediaDeviceEventArgs : public EventArgs
type MediaDeviceEventArgs =
    class
        inherit EventArgs
    end

The MediaDeviceEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | ChildHierarchyChanged | Indicates that the child hiearchy for the object has changed.
Public property | Event | Indicates the event sent.
Public property | ObjectCreationCookie | This is the cookie handed back to a client when it requested an object creation using the IPortableDeviceContent::CreateObjectWithPropertiesAndData method.
Public property | ObjectParentPersistanceUniqueId | Uniquely identifies the parent object, similar to WPD_OBJECT_PARENT_ID, but this ID will not change between sessions.
Public property | OperationProgress | Indicates the progress of a currently executing operation. Value is from 0 to 100, with 100 indicating that the operation is complete.
Public property | OperationState | Indicates the current state of the operation (e.g. started, running, stopped etc.).
Public property | PnpDeviceId | Indicates the device that originated the event.
Public property | ServiceMethodContext | Indicates the service method invocation context.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

MediaDevices Namespace


MediaDeviceEventArgs Properties

MediaDeviceEventArgs Properties

The MediaDeviceEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | ChildHierarchyChanged | Indicates that the child hiearchy for the object has changed.
Public property | Event | Indicates the event sent.
Public property | ObjectCreationCookie | This is the cookie handed back to a client when it requested an object creation using the IPortableDeviceContent::CreateObjectWithPropertiesAndData method.
Public property | ObjectParentPersistanceUniqueId | Uniquely identifies the parent object, similar to WPD_OBJECT_PARENT_ID, but this ID will not change between sessions.
Public property | OperationProgress | Indicates the progress of a currently executing operation. Value is from 0 to 100, with 100 indicating that the operation is complete.
Public property | OperationState | Indicates the current state of the operation (e.g. started, running, stopped etc.).
Public property | PnpDeviceId | Indicates the device that originated the event.
Public property | ServiceMethodContext | Indicates the service method invocation context.
Top
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs.ChildHierarchyChanged Property

MediaDeviceEventArgsChildHierarchyChanged Property
Indicates that the child hiearchy for the object has changed.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public bool ChildHierarchyChanged { get; }
Public ReadOnly Property ChildHierarchyChanged As Boolean
    Get
public:
property bool ChildHierarchyChanged {
    bool get ();
}
member ChildHierarchyChanged : bool with get

Property Value

Type: Boolean
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs.Event Property

MediaDeviceEventArgsEvent Property
Indicates the event sent.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public Events Event { get; }
Public ReadOnly Property Event As Events
    Get
public:
property Events Event {
    Events get ();
}
member Event : Events with get

Property Value

Type: Events
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs.ObjectCreationCookie Property

MediaDeviceEventArgsObjectCreationCookie Property
This is the cookie handed back to a client when it requested an object creation using the IPortableDeviceContent::CreateObjectWithPropertiesAndData method.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string ObjectCreationCookie { get; }
Public ReadOnly Property ObjectCreationCookie As String
    Get
public:
property String^ ObjectCreationCookie {
    String^ get ();
}
member ObjectCreationCookie : string with get

Property Value

Type: String
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs.ObjectParentPersistanceUniqueId Property

MediaDeviceEventArgsObjectParentPersistanceUniqueId Property
Uniquely identifies the parent object, similar to WPD_OBJECT_PARENT_ID, but this ID will not change between sessions.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string ObjectParentPersistanceUniqueId { get; }
Public ReadOnly Property ObjectParentPersistanceUniqueId As String
    Get
public:
property String^ ObjectParentPersistanceUniqueId {
    String^ get ();
}
member ObjectParentPersistanceUniqueId : string with get

Property Value

Type: String
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs.OperationProgress Property

MediaDeviceEventArgsOperationProgress Property
Indicates the progress of a currently executing operation. Value is from 0 to 100, with 100 indicating that the operation is complete.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public uint OperationProgress { get; }
Public ReadOnly Property OperationProgress As UInteger
    Get
public:
property unsigned int OperationProgress {
    unsigned int get ();
}
member OperationProgress : uint32 with get

Property Value

Type: UInt32
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs.OperationState Property

MediaDeviceEventArgsOperationState Property
Indicates the current state of the operation (e.g. started, running, stopped etc.).

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public OperationState OperationState { get; }
Public ReadOnly Property OperationState As OperationState
    Get
public:
property OperationState OperationState {
    OperationState get ();
}
member OperationState : OperationState with get

Property Value

Type: OperationState
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs.PnpDeviceId Property

MediaDeviceEventArgsPnpDeviceId Property
Indicates the device that originated the event.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string PnpDeviceId { get; }
Public ReadOnly Property PnpDeviceId As String
    Get
public:
property String^ PnpDeviceId {
    String^ get ();
}
member PnpDeviceId : string with get

Property Value

Type: String
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs.ServiceMethodContext Property

MediaDeviceEventArgsServiceMethodContext Property
Indicates the service method invocation context.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string ServiceMethodContext { get; }
Public ReadOnly Property ServiceMethodContext As String
    Get
public:
property String^ ServiceMethodContext {
    String^ get ();
}
member ServiceMethodContext : string with get

Property Value

Type: String
See Also

Reference

MediaDeviceEventArgs Class


MediaDeviceEventArgs Methods

MediaDeviceEventArgs Methods

The MediaDeviceEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

MediaDeviceEventArgs Class


MediaFileAttributes Enumeration

MediaFileAttributes Enumeration
Provides attributes for files, directories and objects.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
[FlagsAttribute]
public enum MediaFileAttributes
<FlagsAttribute>
Public Enumeration MediaFileAttributes
[FlagsAttribute]
public enum class MediaFileAttributes
[<FlagsAttribute>]
type MediaFileAttributes
Members
Member name | Value | Description
Normal | 1 | The file is a standard file.
Directory | 2 | The file is a directory.
Object | 4 | The file is a object.
CanDelete | 16 | This file can be deleted.
System | 32 | The file is a system file. That is, the file is part of the operating system or is used exclusively by the operating system.
Hidden | 64 | The file is hidden, and thus is not included in an ordinary directory listing.
DRMProtected | 128 | The file is DRM protected.
See Also

Reference

MediaDevices Namespace


MediaFileInfo Class

MediaFileInfo Class
Provides properties for files, directories and objects.
Inheritance Hierarchy
SystemObject
MediaDevicesMediaFileInfo

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public class MediaFileInfo
Public Class MediaFileInfo
public ref class MediaFileInfo
type MediaFileInfo =  class end

The MediaFileInfo type exposes the following members.

Properties
 | Name | Description
Public property | Attributes | Gets the attributes for the current file, directory or object.
Public property | CreationTime | Gets the creation time of the current file or directory.
Public property | DateAuthored | Gets the time when the current file was authored.
Public property | FullName | Gets the full name of the file.
Public property | LastWriteTime | Gets the time when the current file or directory was last written to.
Public property | Length | Gets the size, in bytes, of the current file.
Public property | Name | Gets the name of the file.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

MediaDevices Namespace


MediaFileInfo Properties

MediaFileInfo Properties

The MediaFileInfo type exposes the following members.

Properties
 | Name | Description
Public property | Attributes | Gets the attributes for the current file, directory or object.
Public property | CreationTime | Gets the creation time of the current file or directory.
Public property | DateAuthored | Gets the time when the current file was authored.
Public property | FullName | Gets the full name of the file.
Public property | LastWriteTime | Gets the time when the current file or directory was last written to.
Public property | Length | Gets the size, in bytes, of the current file.
Public property | Name | Gets the name of the file.
Top
See Also

Reference

MediaFileInfo Class


MediaFileInfo.Attributes Property

MediaFileInfoAttributes Property
Gets the attributes for the current file, directory or object.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public MediaFileAttributes Attributes { get; }
Public ReadOnly Property Attributes As MediaFileAttributes
    Get
public:
property MediaFileAttributes Attributes {
    MediaFileAttributes get ();
}
member Attributes : MediaFileAttributes with get

Property Value

Type: MediaFileAttributes
See Also

Reference

MediaFileInfo Class


MediaFileInfo.CreationTime Property

MediaFileInfoCreationTime Property
Gets the creation time of the current file or directory.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public Nullable<DateTime> CreationTime { get; }
Public ReadOnly Property CreationTime As Nullable(Of DateTime)
    Get
public:
property Nullable<DateTime> CreationTime {
    Nullable<DateTime> get ();
}
member CreationTime : Nullable<DateTime> with get

Property Value

Type: Nullable DateTime
See Also

Reference

MediaFileInfo Class


MediaFileInfo.DateAuthored Property

MediaFileInfoDateAuthored Property
Gets the time when the current file was authored.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public Nullable<DateTime> DateAuthored { get; }
Public ReadOnly Property DateAuthored As Nullable(Of DateTime)
    Get
public:
property Nullable<DateTime> DateAuthored {
    Nullable<DateTime> get ();
}
member DateAuthored : Nullable<DateTime> with get

Property Value

Type: Nullable DateTime
See Also

Reference

MediaFileInfo Class


MediaFileInfo.FullName Property

MediaFileInfoFullName Property
Gets the full name of the file.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string FullName { get; }
Public ReadOnly Property FullName As String
    Get
public:
property String^ FullName {
    String^ get ();
}
member FullName : string with get

Property Value

Type: String
See Also

Reference

MediaFileInfo Class


MediaFileInfo.LastWriteTime Property

MediaFileInfoLastWriteTime Property
Gets the time when the current file or directory was last written to.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public Nullable<DateTime> LastWriteTime { get; }
Public ReadOnly Property LastWriteTime As Nullable(Of DateTime)
    Get
public:
property Nullable<DateTime> LastWriteTime {
    Nullable<DateTime> get ();
}
member LastWriteTime : Nullable<DateTime> with get

Property Value

Type: Nullable DateTime
See Also

Reference

MediaFileInfo Class


MediaFileInfo.Length Property

MediaFileInfoLength Property
Gets the size, in bytes, of the current file.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public ulong Length { get; }
Public ReadOnly Property Length As ULong
    Get
public:
property unsigned long long Length {
    unsigned long long get ();
}
member Length : uint64 with get

Property Value

Type: UInt64
See Also

Reference

MediaFileInfo Class


MediaFileInfo.Name Property

MediaFileInfoName Property
Gets the name of the file.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public string Name { get; }
Public ReadOnly Property Name As String
    Get
public:
property String^ Name {
    String^ get ();
}
member Name : string with get

Property Value

Type: String
See Also

Reference

MediaFileInfo Class


MediaFileInfo Methods

MediaFileInfo Methods

The MediaFileInfo type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

MediaFileInfo Class


NotConnectedException Class

NotConnectedException Class
Represent error that occur if portable device is not connected.
Inheritance Hierarchy
SystemObject
SystemException
MediaDevicesNotConnectedException

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public class NotConnectedException : Exception
Public Class NotConnectedException
    Inherits Exception
public ref class NotConnectedException : public Exception
type NotConnectedException =
    class
        inherit Exception
    end

The NotConnectedException type exposes the following members.

Constructors
 | Name | Description
Public method | NotConnectedException | Initializes a new instance of the PortableDevices.NotConnectedException class.
Public method | NotConnectedException(String) | Initializes a new instance of the PortableDevices.NotConnectedException class with a specified error message.
Public method | NotConnectedException(String, Exception) | Initializes a new instance of the PortableDevices.NotConnectedException class with a specified error message and a reference to the inner exception that is the cause of this exception.
Top
Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
See Also

Reference

MediaDevices Namespace


NotConnectedException Constructor

NotConnectedException Constructor
Overload List
 | Name | Description
Public method | NotConnectedException | Initializes a new instance of the PortableDevices.NotConnectedException class.
Public method | NotConnectedException(String) | Initializes a new instance of the PortableDevices.NotConnectedException class with a specified error message.
Public method | NotConnectedException(String, Exception) | Initializes a new instance of the PortableDevices.NotConnectedException class with a specified error message and a reference to the inner exception that is the cause of this exception.
Top
See Also

Reference

NotConnectedException Class


NotConnectedException Constructor

NotConnectedException Constructor
Initializes a new instance of the PortableDevices.NotConnectedException class.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public NotConnectedException()
Public Sub New
public:
NotConnectedException()
new : unit -> NotConnectedException
See Also

Reference

NotConnectedException Class
NotConnectedException Overload


NotConnectedException Constructor (String)

NotConnectedException Constructor (String)
Initializes a new instance of the PortableDevices.NotConnectedException class with a specified error message.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public NotConnectedException(
    string message
)
Public Sub New (
    message As String
)
public:
NotConnectedException(
    String^ message
)
new :
        message : string -> NotConnectedException

Parameters

message
Type: SystemString
The message that describes the error.
See Also

Reference

NotConnectedException Class
NotConnectedException Overload


NotConnectedException Constructor (String, Exception)

NotConnectedException Constructor (String, Exception)
Initializes a new instance of the PortableDevices.NotConnectedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public NotConnectedException(
    string message,
    Exception innerException
)
Public Sub New (
    message As String,
    innerException As Exception
)
public:
NotConnectedException(
    String^ message,
    Exception^ innerException
)
new :
        message : string *
        innerException : Exception -> NotConnectedException

Parameters

message
Type: SystemString
The message that describes the error.
innerException
Type: SystemException
The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.
See Also

Reference

NotConnectedException Class
NotConnectedException Overload


NotConnectedException Properties

NotConnectedException Properties

The NotConnectedException type exposes the following members.

Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | HResult | Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

NotConnectedException Class


NotConnectedException Methods

NotConnectedException Methods

The NotConnectedException type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
See Also

Reference

NotConnectedException Class


OperationState Enumeration

OperationState Enumeration
Indicates the current state of the operation in progress.

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public enum OperationState
Public Enumeration OperationState
public enum class OperationState
type OperationState
Members
Member name | Value | Description
Unspecified | 0 | Unspecified
Started | 1 | Started
Running | 2 | Running
Paused | 3 | Paused
Cancelled | 4 | Cancelled
Finished | 5 | Finished
Aborted | 6 | Aborted
See Also

Reference

MediaDevices Namespace


PowerSource Enumeration

PowerSource Enumeration
Power source of the device

Namespace: MediaDevices
Assembly: MediaDevices (in MediaDevices.dll) Version: 1.2.0.0 (1.2.0.0)
Syntax
C#
VB
C++
F#
Copy
public enum PowerSource
Public Enumeration PowerSource
public enum class PowerSource
type PowerSource
Members
Member name | Value | Description
Battery | 0 | The power source of the device is battery.
External | 1 | The power source of the device is external.
See Also

Reference

MediaDevices Namespace