static internal log_parser_base create_parser(text_reader reader) { reader.set_setting("type", text_reader.type(reader)); if ( reader.settings.get("guid") == "") reader.set_setting("guid", Guid.NewGuid().ToString()); if (reader is file_text_reader) return create_file_parser(reader as file_text_reader); if (reader is inmem_text_reader) // for testing syntax return new text_file_line_by_line(reader as inmem_text_reader); if (reader is event_log_reader) { if ( reader.settings.get("event.log_type") == "") reader.set_setting("event.log_type", "Application|System"); return new event_viewer(reader as event_log_reader); } if (reader is debug_text_reader) return new debug_print(reader as debug_text_reader); Debug.Assert(false); return null; }
// these are the settings that are to be saved in the context static public settings_as_string get_context_dependent_settings(text_reader reader, settings_as_string_readonly settings) { if (reader is file_text_reader) { return settings.sub(new []{ "syntax", "syntax_type", "aliases" }); } return new settings_as_string( settings.ToString()); }
static internal log_parser_base create_parser(text_reader reader) { var reader_sett = reader.write_settings; reader_sett.type.set( text_reader.type(reader)); if ( reader_sett.guid == "") reader_sett.guid.set( Guid.NewGuid().ToString()); if (reader is file_text_reader) return create_file_parser(reader as file_text_reader); if (reader is inmem_text_reader) // for testing syntax return new text_file_line_by_line(reader as inmem_text_reader); if (reader is event_log_reader) return new event_viewer(reader as event_log_reader); if (reader is debug_text_reader) return new debug_print(reader as debug_text_reader); if (reader is database_table_reader) return new database_log_parser(reader as database_table_reader); Debug.Assert(false); return null; }
// these are the settings that are to be saved in the context static public settings_as_string get_context_dependent_settings(text_reader reader, settings_as_string_readonly settings) { if (reader is file_text_reader) { return(settings.sub(new [] { "syntax", "aliases", "description_template" })); } return(new settings_as_string(settings.ToString())); }
// these are the settings that are to be saved in the context static public log_settings_string get_context_dependent_settings(text_reader reader, log_settings_string_readonly settings) { log_settings_string result; if (reader is file_text_reader) result = settings.sub(new []{ settings.syntax.get(), settings.aliases, settings.description_template }); else result = new log_settings_string( settings.ToString()); result.is_open_first_time.reset(); result.apply_column_positions_to_me.reset(); result.column_positions.reset(); result.available_columns.reset(); return result; }
// these are the settings that are to be saved in the context static public log_settings_string get_context_dependent_settings(text_reader reader, log_settings_string_readonly settings) { log_settings_string result; if (reader is file_text_reader) { result = settings.sub(new [] { settings.syntax.get(), settings.aliases, settings.description_template }); } else { result = new log_settings_string(settings.ToString()); } result.is_open_first_time.reset(); result.apply_column_positions_to_me.reset(); result.column_positions.reset(); result.available_columns.reset(); return(result); }
static internal log_parser_base create_parser(text_reader reader) { var reader_sett = reader.write_settings; reader_sett.type.set(text_reader.type(reader)); if (reader_sett.guid == "") { reader_sett.guid.set(Guid.NewGuid().ToString()); } if (reader is file_text_reader) { return(create_file_parser(reader as file_text_reader)); } if (reader is inmem_text_reader) { // for testing syntax return(new text_file_line_by_line(reader as inmem_text_reader)); } if (reader is event_log_reader) { return(new event_viewer(reader as event_log_reader)); } if (reader is debug_text_reader) { return(new debug_print(reader as debug_text_reader)); } if (reader is database_table_reader) { return(new database_log_parser(reader as database_table_reader)); } Debug.Assert(false); return(null); }
static internal log_parser_base create_parser(text_reader reader) { reader.set_setting("type", text_reader.type(reader)); if (reader.settings.get("guid") == "") { reader.set_setting("guid", Guid.NewGuid().ToString()); } if (reader is file_text_reader) { return(create_file_parser(reader as file_text_reader)); } if (reader is inmem_text_reader) { // for testing syntax return(new text_file_line_by_line(reader as inmem_text_reader)); } if (reader is event_log_reader) { if (reader.settings.get("event.log_type") == "") { reader.set_setting("event.log_type", "Application|System"); } return(new event_viewer(reader as event_log_reader)); } if (reader is debug_text_reader) { return(new debug_print(reader as debug_text_reader)); } Debug.Assert(false); return(null); }
// these are the settings that are to be saved per-log static public log_settings_string get_log_dependent_settings(text_reader reader, log_settings_string_readonly settings) { return(new log_settings_string(settings.ToString())); }
private void on_new_shared_log(string name) { if ( text_ != null) text_.Dispose(); if ( text_ != null && !(text_ is shared_memory_text_reader)) text_ = new shared_memory_text_reader(); ((shared_memory_text_reader)text_).set_memory_name( name); on_new_log(); }
private void on_new_file_log(string name) { if (text_ != null && text_.name == name) return; if ( text_ != null) text_.Dispose(); text_ = new file_text_reader(name); on_new_log(); ui_context file_ctx = file_to_context(name); if (file_ctx != cur_context()) // update context based on file name curContextCtrl.SelectedIndex = contexts_.IndexOf(file_ctx); force_initial_refresh_of_all_views(); }
private void on_new_debug_log() { if ( text_ != null) text_.Dispose(); text_ = new debug_text_reader(); on_new_log(); }
// these are the settings that are to be saved per-log static public settings_as_string get_log_dependent_settings(text_reader reader, settings_as_string_readonly settings) { return new settings_as_string( settings.ToString()); }
// these are the settings that are to be saved in the context static public log_settings_string get_context_dependent_settings(text_reader reader, log_settings_string_readonly settings) { if (reader is file_text_reader) return settings.sub(new []{ settings.syntax.get(), settings.aliases, settings.description_template }); return new log_settings_string( settings.ToString()); }
public log_line_parser(text_reader reader, string syntax) { Debug.Assert(reader != null); line_contains_msg_only_[(int) info_type.msg] = new Tuple<int, int>(0, -1); parse_syntax(syntax); text_reader_ = reader; force_reload(); new Thread(refresh_thread) {IsBackground = true}.Start(); }
// these are the settings that are to be saved in the context static public settings_as_string get_context_dependent_settings(text_reader reader, settings_as_string_readonly settings) { if (reader is file_text_reader) return settings.sub(new []{ "syntax", "aliases", "description_template" }); return new settings_as_string( settings.ToString()); }