Class
DataTransferService

Default implementation of the IDataTransferService.

Definition

Namespace:Telerik.Windows.Controls.Diagrams

Assembly:Telerik.Windows.Controls.Diagrams.dll

Syntax:

cs-api-definition
public class DataTransferService : IDataTransferService

Inheritance: objectDataTransferService

Implements: IDataTransferService

Constructors

DataTransferService(IGraphInternal)

Initializes a new instance of the DataTransferService class.

Declaration

cs-api-definition
public DataTransferService(IGraphInternal graph)

Parameters

graph

IGraphInternal

The diagram control.

Properties

SupportedImageFileExtensions

Gets the supported image file extensions when an image is taken from the clipboard or dragdropped onto the diagram.

Declaration

cs-api-definition
public static IEnumerable<string> SupportedImageFileExtensions { get; }

Property Value

IEnumerable<string>

Methods

CreateImage(Stream)

The transformation of image stream data to an image.

Declaration

cs-api-definition
public Image CreateImage(Stream imageStream)

Parameters

imageStream

Stream

The image stream.

Returns

Image

Implements IDataTransferService.CreateImage(Stream)

CreateShapeFromImage(Image)

Creates a diagram shape for the given image.

Declaration

cs-api-definition
public virtual IShape CreateShapeFromImage(Image image)

Parameters

image

Image

The image to wrap in a shape.

Returns

IShape

Implements IDataTransferService.CreateShapeFromImage(Image)

HandleDrop(DataObject, Action<DataTransferResult>, Action<DataTransferResult>)

Handles the transfer of data when there is a dragdrop action. This can be both an internal dragdrop (from one control to another within the same application) as well as an external dragdrop (from one application to another or from the file system to an application).

Declaration

cs-api-definition
public virtual void HandleDrop(DataObject dataObject, Action<DataTransferResult> fileDropAction, Action<DataTransferResult> elementDropAction)

Parameters

dataObject

DataObject

The data object being transferred.

fileDropAction

Action<DataTransferResult>

The file drop action which will handle the result of the external data transfer.

elementDropAction

Action<DataTransferResult>

The element drop action which will handle the result of the internal data transfer.

Implements IDataTransferService.HandleDrop(DataObject, Action<DataTransferResult>, Action<DataTransferResult>)

HandlePaste(DataObject, Action<DataTransferResult>)

Handles the transfer of data when a copy-paste or cut-paste was performed.

Declaration

cs-api-definition
public virtual void HandlePaste(DataObject dataObject, Action<DataTransferResult> action)

Parameters

dataObject

DataObject

The data object being transferred.

action

Action<DataTransferResult>

The action which will handle the result of the clipboard data transfer.

Implements IDataTransferService.HandlePaste(DataObject, Action<DataTransferResult>)

TryGetDiagramSerializationInfo(DataObject, ref SerializationInfo)

Attempts to fetch the SerializationInfo from the Data.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public bool TryGetDiagramSerializationInfo(DataObject dataObject, ref SerializationInfo serializationInfo)

Parameters

dataObject

DataObject

The data object.

serializationInfo

SerializationInfo

The serialization info.

Returns

bool

TryGetDiagramSerializationInfo(DragEventArgs, ref SerializationInfo)

Attempts to fetch the SerializationInfo from the Data.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
public bool TryGetDiagramSerializationInfo(DragEventArgs args, ref SerializationInfo serializationInfo)

Parameters

args

DragEventArgs

The DragEventArgs instance containing the event data.

serializationInfo

SerializationInfo

The serialization info.

Returns

bool

TryGetDiagramSerializationInfo(string, ref SerializationInfo)

Attempts to fetch the SerializationInfo from the string which supposedly contains a serialized diagram as XML.

Declaration

cs-api-definition
public bool TryGetDiagramSerializationInfo(string diagramXML, ref SerializationInfo serializationInfo)

Parameters

diagramXML

string

The diagram XML.

serializationInfo

SerializationInfo

The serialization info.

Returns

bool

Implements IDataTransferService.TryGetDiagramSerializationInfo(string, ref SerializationInfo)