Exemplo n.º 1
0
        /// <summary>
        /// 返回
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbReturn_Click(object sender, EventArgs e)
        {
            TDataInfoDTO dto      = _client.TDataInfoQueryById(_currentId);
            string       parentId = dto.ParentId;

            IniliazeListView(parentId);
        }
Exemplo n.º 2
0
        public void View(string dataId)
        {
            panel1.Visible = true;
            TDataInfoDTO dto = _client.TDataInfoQueryById(dataId);

            Text = dto.DataName;
            //文件图片
            if (dto.DataName.ToLower().EndsWith(".doc") || dto.DataName.ToLower().EndsWith(".docx") || dto.DataName.ToLower().EndsWith(".ppt") || dto.DataName.ToLower().EndsWith(".pptx") || dto.DataName.ToLower().EndsWith(".xls"))
            {
                string dns = _client.Endpoint.Address.Uri.AbsoluteUri;
                dns            = dns.Remove(dns.LastIndexOf('/'));
                panel1.Visible = false;
                webBrowser1.Navigate(dns + "/FlexPaper/View.htm?name=" + dto.MetaDataId);
            }
            else if (dto.DataName.ToLower().EndsWith(".png") || dto.DataName.ToLower().EndsWith(".jpg") || dto.DataName.ToLower().EndsWith(".bmp") || dto.DataName.ToLower().EndsWith(".jpeg"))
            {
                string dns = _client.Endpoint.Address.Uri.AbsoluteUri;
                dns            = dns.Remove(dns.LastIndexOf('/'));
                panel1.Visible = false;
                webBrowser1.Navigate(dns + "/imgviewer.html?name=" + dto.MetaDataId + Path.GetExtension(dto.DataName));
            }
            else if (dto.DataName.ToLower().EndsWith(".txt"))
            {
                string dns = _client.Endpoint.Address.Uri.AbsoluteUri;
                dns            = dns.Remove(dns.LastIndexOf('/'));
                panel1.Visible = false;
                webBrowser1.Navigate(dns + "/vedios/" + dto.MetaDataId + Path.GetExtension(dto.DataName));
            }
            //视频
            else if (dto.DataName.ToLower().EndsWith("mp4") || dto.DataName.ToLower().EndsWith("ogg") || dto.DataName.ToLower().EndsWith("webm") || dto.DataName.ToLower().EndsWith("flv"))
            {
                string dns = _client.Endpoint.Address.Uri.AbsoluteUri;

                dns = dns.Remove(dns.LastIndexOf('/'));
                //System.Diagnostics.Process.Start("iexplore.exe", "http://" + dns + "/index.html?name=" + dto.DataName);
                panel1.Visible = false;

                webBrowser1.Navigate(dns + "/index.html?name=" + dto.MetaDataId + Path.GetExtension(dto.DataName));
            }
            //压缩文件
            else if (dto.DataName.ToLower().EndsWith("zip") || dto.DataName.ToLower().EndsWith("rar"))
            {
                string path = Path.Combine(Path.GetTempPath(), dto.DataName);
                if (File.Exists(path))
                {
                    System.Diagnostics.Process.Start(path);
                    this.Close();
                }
                if (backgroundWorker1.IsBusy == false)
                {
                    panel1.Visible = true;
                    backgroundWorker1.RunWorkerAsync(new object[] { dto, path });
                }
            }
            else
            {
                progressBar1.Visible = false;
                label1.Text          = "文件类型不支持预览...";
            }
        }