Example #1
0
        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);
        }
Example #2
0
        /// <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);
        }
Example #3
0
        /// <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();
        }