New to Telerik UI for WinFormsStart a free 30-day trial

Default implementation of the IDataTransferService.

Definition

Namespace:Telerik.WinControls.UI.Diagrams

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class DataTransferService : IDataTransferService

Inheritance: objectDataTransferService

Implements: IDataTransferService

Constructors

Initializes a new instance of the DataTransferService class.

C#
public DataTransferService(IGraphInternal graph)
Parameters:graphIGraphInternal

The diagram control.

Properties

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

C#
public static IEnumerable<string> SupportedImageFileExtensions { get; }

Methods

The transformation of image stream data to an image.

C#
public Image CreateImage(Stream imageStream)
Parameters:imageStreamStream

The image stream.

Returns:

Image

Returns a wrapping shape from a given image.

C#
public IShape CreateShapeFromImage(Image image)
Parameters:imageImage

The image to wrap.

Returns:

IShape

Implements: IDataTransferService.CreateShapeFromImage(Image)

Creates a diagram shape for the given image.

C#
public virtual IShape CreateShapeFromImage(Image image)
Parameters:imageImage

The image to wrap in a shape.

Returns:

IShape

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).

C#
public virtual void HandleDrop(DataObject dataObject, Action<DataTransferResult> fileDropAction, Action<DataTransferResult> elementDropAction)
Parameters:dataObjectDataObject

The data object being transferred.

fileDropActionAction<DataTransferResult>

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

elementDropActionAction<DataTransferResult>

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

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

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

C#
public virtual void HandlePaste(DataObject dataObject, Action<DataTransferResult> action)
Parameters:dataObjectDataObject

The data object being transferred.

actionAction<DataTransferResult>

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

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

Attempts to fetch the "SerializationInfo" from the Windows.DragDrop.DragEventArgs.Data.

C#
public bool TryGetDiagramSerializationInfo(DataObject dataObject, ref SerializationInfo serializationInfo)
Parameters:dataObjectDataObject

The data object.

serializationInfoSerializationInfo

The serialization info.

Returns:

bool

Attempts to fetch the "SerializationInfo" from the "Windows.DragDrop.DragEventArgs.Data".

C#
public bool TryGetDiagramSerializationInfo(DragEventArgs args, ref SerializationInfo serializationInfo)
Parameters:argsDragEventArgs

The instance containing the event data.

serializationInfoSerializationInfo

The serialization info.

Returns:

bool

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

C#
public bool TryGetDiagramSerializationInfo(string diagramXML, ref SerializationInfo serializationInfo)
Parameters:diagramXMLstring

The diagram XML.

serializationInfoSerializationInfo

The serialization info.

Returns:

bool

Implements: IDataTransferService.TryGetDiagramSerializationInfo(string, ref SerializationInfo)