private void mToolStripMenuItemRename_Click(object sender, EventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewExplorer))
     {
         this.listViewExplorer.SelectedItems[0].BeginEdit();
     }
 }
 private void listViewExplorer_ItemDrag(object sender, ItemDragEventArgs e)
 {
     if (ListViewKit.hasSelectedItem(listViewExplorer))
     {
         ExplorerFileInfo file = (ExplorerFileInfo)listViewExplorer.SelectedItems[0].Tag;
         listViewExplorer.DoDragDrop(new DataObject(DataFormats.FileDrop, @"C:\Users\Maison\Pictures\iikura_04_l.jpg"), DragDropEffects.Copy);
     }
 }
 /// <summary>
 /// 播放
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripMenuItemPlay_Click(object sender, EventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewRecordList))
     {
         this.axWindowsMediaPlayer1.Ctlcontrols.stop();
         int index = this.listViewRecordList.SelectedItems[0].Index;
         playRecord(index);
     }
 }
 private void listViewExplorer_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewExplorer))
     {
         ExplorerFileInfo file = (ExplorerFileInfo)this.listViewExplorer.SelectedItems[0].Tag;
         // 预览图上显示
         this.labelFileName.Text       = file.FileName;
         this.labelFileDatetime.Text   = "创建时间:" + file.CreateDateTime.ToString("yyyy-MM-dd HH:mm");
         this.labelFileSize.Text       = file.FileSize > 0 ? "文件大小:" + FileKit.FormatFileSize(file.FileSize) : "";
         this.pictureBoxFileIcon.Image = FileKit.GetFileIconImage(this.imageListLargeIcon, file);
     }
 }
Beispiel #5
0
 private void listViewItems_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewItems))
     {
         string   item = this.listViewItems.SelectedItems[0].Text;
         string   cmd  = "shell dumpsys " + item;
         TaskInfo t    = new TaskInfo(TaskType.ExecuteCommand);
         t.Data           = cmd;
         t.ResultHandler += new TaskInfo.EventResultHandler(loadDumpsysItemContentResult);
         taskThread.SendTask(t);
     }
 }
 /// <summary>
 /// 导出
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripMenuItemOutput_Click(object sender, EventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewRecordList))
     {
         string fileName = this.listViewRecordList.SelectedItems[0].Text.Trim();
         string saveFilePath = DialogKit.ShowSaveMediaDialog(fileName);
         if (saveFilePath != null)
         {
             string sourceFilePath = GetScreemRecordPath() + fileName;
             File.Copy(sourceFilePath, saveFilePath);
         }
     }
 }
 private void listViewExplorer_DoubleClick(object sender, EventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewExplorer))
     {
         ExplorerFileInfo file = (ExplorerFileInfo)this.listViewExplorer.SelectedItems[0].Tag;
         if (file.IsFolder)
         {
             string path = file.FileFullPath;
             getNodeList(path, false, new TaskInfo.EventResultHandler(getExplorerListResult));
             this.buttonBackFolder.Enabled = true;
             this.currentExplorerPath      = path;
         }
     }
 }
 private void mToolStripMenuItemExport_Click(object sender, EventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewExplorer))
     {
         ExplorerFileInfo file     = (ExplorerFileInfo)this.listViewExplorer.SelectedItems[0].Tag;
         string           savePath = null;
         if (file.IsFolder)
         {
             // 选择文件夹
             savePath = DialogKit.ShowSaveFolderDialog();
             savePath = Path.Combine(savePath, Path.GetFileName(file.FileFullPath));
         }
         else
         {
             // 选择文件存储路径
             savePath = DialogKit.ShowSaveDialog(file.FileName);
         }
         pullFileFromDevice(file.FileFullPath, savePath);
     }
 }
 /// <summary>
 /// 删除项目
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripMenuItemDelete_Click(object sender, EventArgs e)
 {
     if (ListViewKit.hasSelectedItem(this.listViewRecordList))
     {
         string fileName = this.listViewRecordList.SelectedItems[0].Text.Trim();
         string filePath = GetScreemRecordPath() + fileName;
         string msg = string.Format("是否永久删除文件{0},是否继续?", fileName);
         if (MessageBox.Show(msg, "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         {
             int index = this.listViewRecordList.SelectedItems[0].Index;
             //WMPLib.IWMPMedia media = this.axWindowsMediaPlayer1.currentPlaylist.Item[index];
             // 如果播放的正是当前文件,停止删除
             if (index == currentPlayIndex())
             {
                 this.axWindowsMediaPlayer1.Ctlcontrols.stop();
             }
             File.Delete(filePath);
             updateRecordList();
         }
     }
 }