Beispiel #1
0
        public MainWindow()
        {
            InitializeComponent();

            SetupListView();

            if (!m_Options.LoadFromRegistry())
            {
                // Load default settings.
                string dir      = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location);
                string defaults = Path.Combine(dir, @"DefaultOptions.json");

                m_Options = Options.LoadFromFile(defaults);

                // Show options to allow user to set directory.
                using (var dlg = new OptionsDialog(m_Options))
                {
                    if (DialogResult.OK == dlg.ShowDialog(this))
                    {
                        m_Options = dlg.Options;
                    }
                }
            }

            m_Listener                = new TraceListener(this);
            m_Listener.BindAddress    = IPAddress.Parse(m_Options.BindAddress);
            m_Listener.BindPort       = m_Options.BindPort;
            m_Listener.TraceDirectory = m_Options.TraceDirectory;

            m_Listener.Start();

            ScanTraceDirectory();
        }