Пример #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);
        }
Пример #2
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();
        }