/// <summary>
        /// Create new project
        /// </summary>
        /// <param name="fileName">Log file name</param>
        /// <param name="logStream">Log file stream</param>
        /// <param name="projectName">Project name</param>
        /// <param name="patternDef">Analyzing pattern</param>
        /// <param name="enc">Log file encoding</param>
        /// <returns>Created project</returns>
        public FlatProject CreateProject(string fileName, Stream logStream, string projectName, PatternDefinition patternDef, Encoding enc)
        {
            log.In(logStream, projectName, patternDef);

            if (patternDef == null)
            {
                patternDef = PatternDefinition.CreateDefault();
            }

            currentProject                   = new FlatProject();
            currentProject.ProjectName       = projectName;
            currentProject.PatternDefinition = patternDef;

            string tempDir = CreateTempDirectory();

            currentProject.WorkingDirectory = tempDir;

            string logFileName = CreateDatabaseFilePath(currentProject);

            using (IntermediateLogWriter imLogWriter = new IntermediateLogWriter(logFileName, patternDef))
            {
                imLogWriter.Write(fileName, logStream, enc);
            }

            reader = new IntermediateLogReader(logFileName, currentProject.PatternDefinition);

            log.Out(currentProject);
            return(currentProject);
        }
        /// <summary>
        /// Import log file to database
        /// </summary>
        /// <param name="fileName">Log file name</param>
        /// <param name="logStream">Log file stream</param>
        /// <param name="enc">Log file encoding</param>
        public void ImportLog(string fileName, Stream logStream, Encoding enc)
        {
            log.In(fileName, logStream, enc);

            PatternDefinition patternDef  = currentProject.PatternDefinition;
            string            logFileName = CreateDatabaseFilePath(currentProject);

            using (IntermediateLogWriter imLogWriter = new IntermediateLogWriter(logFileName, patternDef))
            {
                imLogWriter.Write(fileName, logStream, enc);
            }

            log.Out();
        }