Exemple #1
0
        private void on_new_log()
        {
            dropHere.Visible = false;

            // by default - try to find the syntax by reading the header info
            //              otherwise, try to parse it
            string syntax = null;
            if (text_ is file_text_reader)
                syntax = log_to_default_syntax.file_to_syntax(text_.name);
            if ( syntax == null)
                syntax = text_.try_to_find_log_syntax();
            string name = text_.name;

            if (history_.Count < 1)
                history_select(name);

            if ( logSyntaxCtrl.Text == "")
                logSyntaxCtrl.Text = syntax;
            if ( util.is_debug)
                logSyntaxCtrl.Text = syntax;

            // note: we recreate the log, so that cached filters know to rebuild
            log_parser_ = new log_line_parser(text_, logSyntaxCtrl.Text);
            on_new_log_parser();

            fullLogCtrl.set_filter(new List<filter_row>());

            Text = reader_title() + " - Log Wizard " + version();
            if ( logHistory.SelectedIndex == last_sel)
                // note: sometimes this gets called twice - for instance, when user drops the combo and then selects an entry with the mouse
                return;
            last_sel = logHistory.SelectedIndex;
            add_reader_to_history();
            ui_context cur = cur_context();
            for ( int idx = 0; idx < cur.views.Count; ++idx)
                ensure_we_have_log_view_for_tab(idx);
            load_bookmarks();
            logger.Info("new reader_ " + history_[logHistory.SelectedIndex].name);

            // at this point, some file has been dropped
            log_view_for_tab(0).Visible = true;
        }
 public log_line_reader(log_line_parser parser)
 {
     Debug.Assert(parser != null);
     parser_ = parser;
 }
 public log_line_reader(log_line_parser parser)
 {
     Debug.Assert(parser != null);
     parser_ = parser;
 }