Exemplo n.º 1
0
        protected virtual void on_updated_settings()
        {
            var new_aliases = new aliases(sett_.get("aliases"));

            if (aliases_ != null && aliases_.to_enter_separated_string() == new_aliases.to_enter_separated_string())
            {
                // nothing changed
                return;
            }

            aliases_ = new_aliases;
            if (column_names_.Count > 0)
            {
                aliases_.on_column_names(column_names_);
            }
        }
Exemplo n.º 2
0
        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;
        }