[Mono-bugs] [Bug 542079] New: Clipboard.SetFileDropList and Clipboard.SetImage or Clipboard.ContainsFileDropList and Clipboard.ContainsImage don't work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Sep 25 04:18:54 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=542079


           Summary: Clipboard.SetFileDropList and Clipboard.SetImage or
                    Clipboard.ContainsFileDropList and
                    Clipboard.ContainsImage don't work
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: i686
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jhmgbl2 at t-online.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14)
Gecko/2009090216 Ubuntu/8.04 (hardy) Firefox/3.0.3, Ant.com

Code works with .Net-Framework but not with Mono 2.4.2.3

Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles CopyToolStripMenuItem.Click

    Const CodeLoc As String = ClassName & ".CopyToolStripMenuItem_Click"

    gStatus = CodeLoc & " Start"

    Dim LVITem As ListViewItem

    Dim filePaths As New System.Collections.Specialized.StringCollection

    If Not _tvIsSelected Then

      If Listview.VirtualMode Then

        For Each LVITem In Listview.ColSelected

          filePaths.Add(CStr(LVITem.Name))

        Next

      Else

        For Each LVITem In Listview.SelectedItems

          filePaths.Add(CStr(LVITem.Name))

        Next

      End If



      If filePaths.Count > 0 Then

        cutFileList.Clear()

        copyFileList = filePaths

        gStatus = CodeLoc & " SetFileDropList"

        Clipboard.SetFileDropList(filePaths)

        If filePaths.Count = 1 AndAlso Listview.SelLVItem IsNot Nothing Then

          Dim lvItemProps As LVItemProps = DirectCast(Listview.SelLVItem.Tag,
LVItemProps)

          If lvItemProps.Img IsNot Nothing Then

            gStatus = CodeLoc & " SetImage"

            Clipboard.SetImage(lvItemProps.Img)

          End If

        End If

        _blnCut = False

        PasteToolStripMenuItem.Enabled = True

        cmnuB.Items(PasteToolStripMenuItem.Name).Enabled = True

      End If



    Else



      If clsTV.SelectedNode IsNot Nothing Then

        filePaths.Add(clsTV.SelectedNode.Name)

        copyFileList = filePaths

        cutFileList.Clear()

        gStatus = CodeLoc & " SetFileDropList TV"

        Clipboard.SetFileDropList(filePaths)

        _blnCut = False

        PasteToolStripMenuItem.Enabled = True

        cmnuB.Items(PasteToolStripMenuItem.Name).Enabled = True

      End If



    End If



  End Sub



  Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles PasteToolStripMenuItem.Click

    Const CodeLoc As String = ClassName & ".PasteToolStripMenuItem_Click"

    gStatus = CodeLoc & " Start"

    Dim fdl As System.Collections.Specialized.StringCollection





    If Clipboard.ContainsFileDropList Then

          gStatus = CodeLoc & " GetFileDropList"

          fdl = Clipboard.GetFileDropList

          If _blnCut Then

            _blnCut = StringCollectionEquals(fdl, cutFileList)

          End If

          gStatus = CodeLoc & " CopyOrMoveFiles"

          CopyOrMoveFiles(fdl, _blnCut)



          cutFileList.Clear()

          copyFileList.Clear()

          If _blnCut Then Clipboard.Clear()

        ElseIf Clipboard.ContainsImage Then

          gStatus = CodeLoc & " GetImage"

          Dim img As Image = Clipboard.GetImage

          If img IsNot Nothing AndAlso img.Width > 0 AndAlso img.Height > 0
Then

            gStatus = CodeLoc & " InsertLVItem"

            Listview.InsertLVItem(img, , , True, , , Listview.GetInsertPath("",
"PasteImage.jpg", False))

          End If

        Else



          PasteToolStripMenuItem.Enabled = False

          cmnuB.Items(PasteToolStripMenuItem.Name).Enabled = False

        End If

      End Sub

Reproducible: Always

Steps to Reproduce:
1. Download
http://sourceforge.net/projects/photoprinter/files/Mono/JMGPhotoPrinterMONO_0_7_0_16.tar.bz2/download
and run program.
2. Copy a file, or open an image and make a selection and select edit:copy
3. paste a file or the image in the main window
Actual Results:  
nothing happens

Expected Results:  
a new file or an image should be inserted

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list