// 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()); }
public static bool is_single_line(string file, settings_as_string_readonly sett) { string[] lines = util.read_beginning_of_file(file, 16834).Split('\n'); for (int index = 0; index < lines.Length; index++) { lines[index] = lines[index].Replace("\r", ""); } int empty_lines = 0; string separator = sett.get("part.separator"); if (separator == "") { separator = ":"; } int contains_separator = 0; foreach (string line in lines) { if (line == "") { ++empty_lines; } else if (line.Contains(separator)) { ++contains_separator; } } // at least 3 entries if (empty_lines > 3) { if (contains_separator + empty_lines == lines.Length) { return(true); } } return(false); }
public static bool is_single_line(string file, settings_as_string_readonly sett) { string[] lines = util.read_beginning_of_file(file, 16834).Split( '\n' ); for (int index = 0; index < lines.Length; index++) lines[index] = lines[index].Replace("\r", ""); int empty_lines = 0; string separator = sett.get("part.separator"); if (separator == "") separator = ":"; int contains_separator = 0; foreach ( string line in lines) if (line == "") ++empty_lines; else if (line.Contains(separator)) ++contains_separator; // at least 3 entries if ( empty_lines > 3) if (contains_separator + empty_lines == lines.Length) return true; return false; }
protected log_parser_base(settings_as_string_readonly sett) { sett_ = sett; sett_.on_changed += on_settings_changed; on_updated_settings(); }
// 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 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 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 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()); }