Exemplo n.º 1
0
        private void toolStripMenuItemExportFolderListView_Click(object sender, EventArgs e)
        {
            if (this.m_FormNotifyIcon.folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                this.treeView.Enabled = false;
                this.listView.Enabled = false;
                this.toolStripButtonBack.Enabled = false;
                this.toolStripButtonExport.Enabled = false;
                this.toolStripSplitButtonOpen.Enabled = false;
                this.toolStripButtonSearch.Enabled = false;
                this.toolStripSplitButtonLayout.Enabled = false;
                this.toolStripSplitButtonViews.Enabled = false;
                this.toolStripTextBoxSearch.Enabled = false;
                this.toolStripButtonAbout.Enabled = false;
                this.toolStripButtonFilter.Enabled = false;

                DataView tempDataView = new DataView(this.m_TREFile.DataTable, "(path LIKE '/" + this.m_DataViewListView[this.listView.SelectedIndices[0]]["name"].ToString().TrimStart(new Char[] { '/' }) + "%') AND (File_Type NOT LIKE 'File Folder')", String.Empty, DataViewRowState.CurrentRows);
                DataTable tempDataTable = this.m_DataViewListView.ToTable();
                tempDataTable.Rows.Clear();
                foreach (DataRowView dataRowView in tempDataView)
                {
                    tempDataTable.ImportRow(dataRowView.Row);
                }

                ExtractData passedData = new ExtractData();
                passedData.Path = this.m_FormNotifyIcon.folderBrowserDialog.SelectedPath;
                passedData.DataTable = tempDataTable;

                this.m_FormProgress.Show();

                m_Thread = new Thread(new ParameterizedThreadStart(this.ExtractThread));
                m_Thread.Start(passedData);
            }
        }
Exemplo n.º 2
0
        private void toolStripMenuItemExportFolderTreeView_Click(object sender, EventArgs e)
        {
            if (this.Text.Contains("/"))
            {
                if (this.m_FormNotifyIcon.folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    this.treeView.Enabled = false;
                    this.listView.Enabled = false;
                    this.toolStripButtonBack.Enabled = false;
                    this.toolStripButtonExport.Enabled = false;
                    this.toolStripSplitButtonOpen.Enabled = false;
                    this.toolStripButtonSearch.Enabled = false;
                    this.toolStripSplitButtonLayout.Enabled = false;
                    this.toolStripSplitButtonViews.Enabled = false;
                    this.toolStripTextBoxSearch.Enabled = false;
                    this.toolStripButtonAbout.Enabled = false;
                    this.toolStripButtonFilter.Enabled = false;

                    DataView tempDataView = new DataView(this.m_TREFile.DataTable, "(path LIKE '/" + m_LastClickedTreeNode.Tag.ToString().Trim(new Char[] { '/' }) + "/%') AND (File_Type NOT LIKE 'File Folder')", String.Empty, DataViewRowState.CurrentRows);
                    DataTable tempDataTable = this.m_DataViewListView.ToTable();
                    tempDataTable.Rows.Clear();
                    foreach (DataRowView dataRowView in tempDataView)
                    {
                        tempDataTable.ImportRow(dataRowView.Row);
                    }

                    ExtractData passedData = new ExtractData();
                    passedData.Path = this.m_FormNotifyIcon.folderBrowserDialog.SelectedPath;
                    passedData.DataTable = tempDataTable;

                    this.m_FormProgress.Show();

                    m_Thread = new Thread(new ParameterizedThreadStart(this.ExtractThread));
                    m_Thread.Start(passedData);
                }
            }
            else
            {
                MessageBox.Show("You must first load a file.", "TRE Explorer", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 3
0
        private void toolStripButtonExtract_Click(object sender, EventArgs e)
        {
            if ((this.listView.SelectedIndices.Count == 1) && ((String)this.m_DataViewListView[this.listView.SelectedIndices[0]]["File_Type"] != "File Folder"))
            {
                if ((String)this.m_DataViewListView[this.listView.SelectedIndices[0]]["File_Type"] != "File Folder")
                {
                    DataRow dataRow = this.m_DataViewListView[this.listView.SelectedIndices[0]].Row;
                    String Name = (String)dataRow["Name"];
                    Byte[] buffer = Utilities.InflateFile(dataRow);
                    this.m_FormNotifyIcon.saveFileDialog.FileName = Name.Substring(Name.LastIndexOf("/") + 1);
                    this.m_FormNotifyIcon.saveFileDialog.Filter = Name.Substring(Name.LastIndexOf(".") + 1).ToUpper() + " Files|*." + Name.Substring(Name.LastIndexOf(".") + 1).ToLower();
                    if (this.m_FormNotifyIcon.saveFileDialog.ShowDialog() == DialogResult.OK)
                    {
                        try
                        {
                            FileStream fileStream = new FileStream(this.m_FormNotifyIcon.saveFileDialog.FileName, FileMode.Create, FileAccess.Write, FileShare.Write);
                            fileStream.Write(buffer, 0, buffer.Length);
                            fileStream.Close();
                        }
                        catch
                        {
                        }
                    }
                }
            }
            else
            {
                if (this.m_FormNotifyIcon.folderBrowserDialog.ShowDialog() == DialogResult.OK)
                {
                    this.treeView.Enabled = false;
                    this.listView.Enabled = false;
                    this.toolStripButtonBack.Enabled = false;
                    this.toolStripButtonExport.Enabled = false;
                    this.toolStripSplitButtonOpen.Enabled = false;
                    this.toolStripButtonSearch.Enabled = false;
                    this.toolStripSplitButtonLayout.Enabled = false;
                    this.toolStripSplitButtonViews.Enabled = false;
                    this.toolStripTextBoxSearch.Enabled = false;
                    this.toolStripButtonAbout.Enabled = false;
                    this.toolStripButtonFilter.Enabled = false;
                    this.toolStripButtonExportFileChain.Enabled = false;

                    ExtractData passedData = new ExtractData();
                    passedData.Path = this.m_FormNotifyIcon.folderBrowserDialog.SelectedPath;
                    passedData.DataTable = this.RetrieveSelection();

                    this.m_FormProgress.Show();

                    m_Thread = new Thread(new ParameterizedThreadStart(this.ExtractThread));
                    m_Thread.Name = "Extract";
                    m_Thread.Start(passedData);
                }
            }
        }