Esempio n. 1
0
        /// <summary>
        /// 
        /// </summary>
        public ControlEvents()
        {
            InitializeComponent();

            Helper.AddListColumn(listEvents, "Src IP", "IpSrcTxt");
            Helper.AddListColumn(listEvents, "Src Port", "SrcPort");
            Helper.AddListColumn(listEvents, "Dst IP", "IpDstTxt");
            Helper.AddListColumn(listEvents, "Dst Port", "DstPort");
            Helper.AddListColumn(listEvents, "Protocol", "Protocol");
            Helper.AddListColumn(listEvents, "Host", "HttpHost");
            Helper.AddListColumn(listEvents, "Timestamp", "Timestamp");
            Helper.AddListColumn(listEvents, "TCP Flags", "TcpFlagsString");
            Helper.AddListColumn(listEvents, "Classification", "AcknowledgmentClass");
            Helper.AddListColumn(listEvents, "Initials", "Initials");
            Helper.AddListColumn(listEvents, "Signature", "SigName");
            Helper.AddListColumn(listEvents, "Sensor", "SensorName");
            Helper.AddListColumn(listEvents, "Payload (ASCII)", "PayloadAscii");
            Helper.ResizeEventListColumns(listEvents, true);

            _querier = new Querier();
            _querier.Error += OnQuerier_Error;
            _querier.Exclamation += OnQuerier_Exclamation;
            _querier.EventQueryComplete += OnQuerier_EventQueryComplete;

            Settings settings = new Settings();
            if (settings.FileExists == true)
            {
                string ret = settings.Load();
                if (ret.Length > 0)
                {
                    UserInterface.DisplayErrorMessageBox("An error occurred whilst loading the settings file: " + ret);
                }
                else
                {
                    _timerRefresh = new System.Timers.Timer();
                    _timerRefresh.Elapsed += OnTimerRefresh_Elapsed;
                    _timerRefresh.Interval = (settings.EventsRefresh * 60000); // Convert to milliseconds
                    _timerRefresh.Enabled = true;
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormMain_Load(object sender, EventArgs e)
        {
            _settings = new Settings();
            if (_settings.FileExists == true)
            {
                string ret = _settings.Load();
                if (ret.Length > 0)
                {
                    UserInterface.DisplayErrorMessageBox(this, ret);
                }
                else
                {
                    this.WindowState = _settings.FormState;

                    if (_settings.FormState != FormWindowState.Maximized)
                    {
                        this.Location = _settings.FormLocation;
                        this.Size = _settings.FormSize;
                    }
                }
            }
        }