Exemplo n.º 1
0
 public DownFile(Down down)
 {
     this.down = down;
     InitializeComponent();
     this.FormClosed += new FormClosedEventHandler(DownFile_FormClosed);
     IsCheckTable = new List<CheckB>();
     this.Text += "---" + down.FullName;
   
 }
Exemplo n.º 2
0
        private void _Down_Click(object sender, EventArgs e)
        {
            if (this.listView1.SelectedItems.Count > 0)
            {
                FileSystem downFile = (this.listView1.SelectedItems[this.listView1.SelectedItems.Count - 1].Tag as FileSystem);

                if (downFile != null)
                {
                    Down down = new Down()
                    {
                        FullName=downFile.FullName                       

                    };

                    SocketManager.Send(BufferFormatV2.FormatFCA(down, Deflate.Compress));

                }

            }
        }
Exemplo n.º 3
0
        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0)
            {
                ListViewItem item = listView1.SelectedItems[listView1.SelectedItems.Count - 1];


                string DirName = "";

                FileSystem dirinfo = item.Tag as FileSystem;

                if (dirinfo != null)
                {
                    if (dirinfo.FileType == FileType.Dir)
                    {
                        DirName = dirinfo.FullName;
                    }
                    else
                    {
                        if (MessageBox.Show("是否下载文件:" + dirinfo.Name + "?","提示",MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            FileSystem downFile = (this.listView1.SelectedItems[this.listView1.SelectedItems.Count - 1].Tag as FileSystem);

                            if (downFile != null)
                            {
                                Down down = new Down()
                                {
                                    FullName = downFile.FullName

                                };

                                SocketManager.Send(BufferFormatV2.FormatFCA(down, Deflate.Compress));

                            }

                        }

                        return;
                    }

                }
                else
                {

                    DiskInfo info = item.Tag as DiskInfo;

                    if (info != null)
                        DirName = info.Name;

                }


                Dir tmp = new Dir()
                {
                    DirName=DirName,
                    FileSystemList = new List<FileSystem>(),
                    IsSuccess = false,
                    Msg = ""
                };

                SocketManager.Send(BufferFormatV2.FormatFCA(tmp,Deflate.Compress));
              
            }
        }