public FormWSFind(WSFile wsFile) { InitializeComponent(); this.m_WSFile = wsFile; InitializeDataTable(); foreach (String type in this.m_WSFile.Types) { String ObjectType = FormIFFILFWSEditor.WSObjectType(type); this.m_DataTable.Rows.Add(new Object[] { ((ObjectType == String.Empty) ? "Unknown" : ObjectType) , type }); } DataSet dataSet = new DataSet(); DataSetHelper dataSetHelper = new DataSetHelper(ref dataSet); DataTable dataTableTypes = dataSetHelper.SelectDistinct("Types", this.m_DataTable, "Type"); this.comboBoxTypes.Items.Clear(); foreach (DataRow dataRow in dataTableTypes.Rows) { this.comboBoxTypes.Items.Add(dataRow["Type"]); } this.comboBoxTypes.SelectedIndex = 0; }
private TreeNode CreateTreeNodes(DataTable dataTable) { TreeNode returnValue = new TreeNode(); returnValue.Name = "/"; returnValue.Text = "/"; returnValue.Tag = "/"; returnValue.ContextMenuStrip = m_form.contextMenuStripTreeView; DataSet dataSet = new DataSet(); DataSetHelper dataSetHelper = new DataSetHelper(ref dataSet); DataTable dataTablePaths = dataSetHelper.SelectDistinct("Paths", dataTable, "path"); for (Int32 counter = 0; counter < dataTablePaths.Rows.Count; counter++) { DataRow dataRow = dataTablePaths.Rows[counter]; TreeNode treeNode = returnValue; String fullpath = "/"; foreach (String folder in dataRow[0].ToString().Split(new Char[] { '/' }, StringSplitOptions.RemoveEmptyEntries)) { fullpath += folder + "/"; if (!treeNode.Nodes.ContainsKey(folder)) { treeNode = treeNode.Nodes.Add(folder, folder); treeNode.ContextMenuStrip = m_form.contextMenuStripTreeView; treeNode.Tag = fullpath; } else { treeNode = treeNode.Nodes[folder]; } } if (m_EventStop.WaitOne(0, true)) { this.m_Cancelled = true; m_EventStopped.Set(); return null; } } return returnValue; }
private String[][] CreateFilterLists(DataTable dataTable) { DataSet dataSet = new DataSet(); DataSetHelper dataSetHelper = new DataSetHelper(ref dataSet); DataTable dataTableContainers = dataSetHelper.SelectDistinct("Containers", dataTable, "filename"); DataTable dataTableFileTypes = dataSetHelper.SelectDistinct("FileTypes", dataTable, "file_type"); List<String[]> returnValue = new List<String[]>(); List<String> listString = new List<String>(); for (Int32 counter = 0; counter < dataTableContainers.Rows.Count; counter++) { DataRow dataRow = dataTableContainers.Rows[counter]; listString.Add(dataRow[0].ToString().Substring(dataRow[0].ToString().LastIndexOf("\\") + 1)); if (m_EventStop.WaitOne(0, true)) { m_EventStopped.Set(); return null; } } returnValue.Add(listString.ToArray()); listString.Clear(); for (Int32 counter = 0; counter < dataTableFileTypes.Rows.Count; counter++) { DataRow dataRow = dataTableFileTypes.Rows[counter]; listString.Add(dataRow[0].ToString()); if (m_EventStop.WaitOne(0, true)) { this.m_Cancelled = true; m_EventStopped.Set(); return null; } } returnValue.Add(listString.ToArray()); listString.Clear(); return returnValue.ToArray(); }