コード例 #1
0
        public override string try_to_find_log_syntax()
        {
            if (cached_syntax_ != "")
            {
                return(cached_syntax_);
            }

            try {
                using (var fs = new FileStream(file_, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) {
                    string found = new find_log_syntax().try_find_log_syntax(fs);
                    if (found != UNKNOWN_SYNTAX)
                    {
                        cached_syntax_ = found;
                    }
                    return(found);
                }
            } catch {
                return(UNKNOWN_SYNTAX);
            }
        }
コード例 #2
0
ファイル: file_text_reader.cs プロジェクト: noelhx/logwizard
        public override string try_to_find_log_syntax() {
            if (cached_syntax_ != "")
                return cached_syntax_;

            try {
                using (var fs = new FileStream(file_, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) {
                    string found = new find_log_syntax().try_find_log_syntax(fs);
                    if (found != UNKNOWN_SYNTAX)
                        cached_syntax_ = found;
                    return found;
                }
            } catch {
                return UNKNOWN_SYNTAX;
            }
        }