Skip to content
20 changes: 13 additions & 7 deletions Plain Craft Launcher 2/FormMain.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -742,17 +742,23 @@ Public Class FormMain
End If
'确定拖放效果
e.Effects = DragDropEffects.None
If e.Data.GetDataPresent(DataFormats.Text) Then
Dim Str As String = e.Data.GetData(DataFormats.Text)
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim Files As String() = e.Data.GetData(DataFormats.FileDrop)
If Files IsNot Nothing AndAlso Files.Length > 0 Then
e.Effects = DragDropEffects.Link
End If
ElseIf e.Data.GetDataPresent(DataFormats.Text) Then
Dim Str As String = TryCast(e.Data.GetData(DataFormats.Text), String)
If Str Is Nothing Then
PrevData = e.Data
Return
End If
If Str.StartsWithF("authlib-injector:yggdrasil-server:") Then
e.Effects = DragDropEffects.Copy
ElseIf Str.StartsWithF("file:///") Then
e.Effects = DragDropEffects.Copy
End If
ElseIf e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim Files As String() = e.Data.GetData(DataFormats.FileDrop)
If Files IsNot Nothing AndAlso Files.Length > 0 Then
e.Effects = DragDropEffects.Link
ElseIf (Str.Contains(":\") OrElse Str.Contains("\")) AndAlso File.Exists(Str) Then
e.Effects = DragDropEffects.Copy
End If
End If
PrevData = e.Data
Expand Down
Loading