You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
To allow drag&drop files from explorer i had to handle Uri[] also in ToDataObject
namespace Xwt.WPFBackend
{
internal static class DataConverter
{
public static DataObject ToDataObject (this TransferDataSource data)
{
var retval = new DataObject ();
foreach (var type in data.DataTypes) {
var value = data.GetValue (type);
if (type == TransferDataType.Text)
retval.SetText ((string)value);
else if (type == TransferDataType.Uri) {
var uris = new StringCollection ();
<<<<<<<<<<<
if (value is Uri[]) {
foreach (var uri in value as Uri[])
uris.Add(uri.LocalPath);
}
else
<<<<<<<<<<<<
uris.Add (((Uri)value).LocalPath);
retval.SetFileDropList (uris);
} else
retval.SetData (type.Id, TransferDataSource.SerializeValue (value));
}
return retval;
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
To allow drag&drop files from explorer i had to handle Uri[] also in ToDataObject
namespace Xwt.WPFBackend
{
internal static class DataConverter
{
public static DataObject ToDataObject (this TransferDataSource data)
{
var retval = new DataObject ();
foreach (var type in data.DataTypes) {
var value = data.GetValue (type);
<<<<<<<<<<<
if (value is Uri[]) {
foreach (var uri in value as Uri[])
uris.Add(uri.LocalPath);
}
else
<<<<<<<<<<<<
uris.Add (((Uri)value).LocalPath);
retval.SetFileDropList (uris);
} else
retval.SetData (type.Id, TransferDataSource.SerializeValue (value));
}
The text was updated successfully, but these errors were encountered: