Example #1
0
        private void WorkerSearch_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            SearchEventArgs sea          = (SearchEventArgs)e.Result;
            List <LogPos>   searchResult = streamingFactory.GetSearchResult(sea);

            if (searchResult != null && searchResult.Count > 0)
            {
                TabPage        tp  = new TabPage();
                LogListControl llc = new LogListControl();

                tp.Controls.Add(llc);
                llc.Dock = DockStyle.Fill;
                llc.DoubleClickListView += LogListControlMain_DoubleClickListView;
                llc.Follow = logListControlMain.Follow;
                tp.Name    = "tabPageSearchResult";
                tp.Padding = new System.Windows.Forms.Padding(3);
                tp.Text    = "Search Result";
                tp.UseVisualStyleBackColor = true;
                tabControlMain.TabPages.Add(tp);
                tabControlMain.SelectedTab = tp;
                llc.SetStreamingFactory(streamingFactory, sea);
            }

            logListControlMain.Enabled = true;
            foreach (TabPage tp in tabControlMain.TabPages)
            {
                tp.Controls[0].Enabled = true;
            }
            this.Cursor = Cursors.Default;
        }
Example #2
0
        public MainForm()
        {
            InitializeComponent();

            selectedLogListControl = logListControlMain;
            this.Size        = new Size(1600, 800);
            streamingFactory = new StreamingFactory();
            selectedLogListControl.SetStreamingFactory(streamingFactory, null);
            streamingFactory.IsInconsistent += StreamingFactory_IsInConsistent;
            currentMainForm = this;
            workerIndex     = new BackgroundWorker();
            workerIndex.WorkerReportsProgress      = true;
            workerIndex.WorkerSupportsCancellation = true;
            workerIndex.ProgressChanged           += WorkerIndex_ProgressChanged;
            workerIndex.DoWork             += WorkerIndex_DoWork;
            workerIndex.RunWorkerCompleted += WorkerIndex_RunWorkerCompleted;

            workerSearch = new BackgroundWorker();
            workerSearch.WorkerReportsProgress      = true;
            workerSearch.WorkerSupportsCancellation = true;
            workerSearch.ProgressChanged           += WorkerSearch_ProgressChanged;
            workerSearch.DoWork             += WorkerSearch_DoWork;
            workerSearch.RunWorkerCompleted += WorkerSearch_RunWorkerCompleted;

            timerNewLogFilesAdded          = new System.Windows.Forms.Timer();
            timerNewLogFilesAdded.Interval = 500;
            timerNewLogFilesAdded.Enabled  = false;
            timerNewLogFilesAdded.Tick    += TimerNewLogFilesAdded_Tick;
        }