TransferTargetInvokeResult Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The TransferTargetInvokeResult class represents the result of an attempt to invoke a transfer target. It provides information about whether the invocation succeeded and any associated error details.
public ref class TransferTargetInvokeResult sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 1245184)]
/// [Windows.Foundation.Metadata.Experimental]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class TransferTargetInvokeResult final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 1245184)]
[Windows.Foundation.Metadata.Experimental]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class TransferTargetInvokeResult
Public NotInheritable Class TransferTargetInvokeResult
- Inheritance
- Attributes
Windows requirements
| Requirements | Description |
|---|---|
| Device family |
Windows 11, version 24H2 (introduced in 10.0.26100.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced in v19.0)
|
Examples
Example: Handling the Result of a Transfer Target Invocation
var result = await watcher.TransferToAsync(target, dataPackage);
if (result.Succeeded)
{
Console.WriteLine("Transfer succeeded.");
}
else
{
Console.WriteLine($"Transfer failed with error: {result.ExtendedError}");
}
Remarks
This class is used to capture the outcome of invoking a transfer target with a data package. It helps developers handle success and error scenarios effectively.
Key Properties:
Succeeded: Indicates whether the invocation was successful.ExtendedError: Provides additional error information if the invocation failed.
Usage:
The TransferTargetInvokeResult is returned by methods such as TransferTargetWatcher.TransferToAsync to indicate the result of the operation.
Properties
| Name | Description |
|---|---|
| ExtendedError |
The |
| Succeeded |
The |