public bool LoadNetworkTrace() { if (ApplicationState.Idle != StateManager.GetState()) { return(false); } DialogResult dResult = oFDNetworkTrace.ShowDialog(); if (DialogResult.OK != dResult) { return(false); } foreach (String filename in oFDNetworkTrace.FileNames) { if (!File.Exists(filename) || NetworkTraceSet.LoadedTraces.Any(item => item.FullName == filename)) { continue; } NetworkTraceSet.Add(new NetworkTraceInfo(filename)); } tBPathNetworkTrace.Clear(); return(true); }
/// <summary> /// Delete button handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (ApplicationState.Idle != StateManager.GetState()) { return; } if (-1 == e.RowIndex) { return; } if ((int)eGridViewColumns.Delete != e.ColumnIndex) { return; } NetworkTraceSet.RemoveAt(e.RowIndex); }
/// <summary> /// Add Network Trace button handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddNetworkTrace_Click(object sender, EventArgs e) { if (ApplicationState.Idle != StateManager.GetState()) { return; } String pFilename = tBPathNetworkTrace.Text.Trim(); if (File.Exists(pFilename) && NetworkTraceSet.LoadedTraces.All(item => item.FullName != pFilename)) { NetworkTraceSet.Add(new NetworkTraceInfo(pFilename)); tBPathNetworkTrace.Clear(); return; } LoadNetworkTrace(); }