/// <summary> /// Az könyvtárban található fájlok betöltése /// </summary> /// <param name="location">könyvtár útvonal</param> void LoadFiles(string location) { this.Clear(); if (System.IO.Directory.Exists(location) && System.IO.Directory.GetFiles(location).FirstOrDefault(n => n.EndsWith(".s3db")) != null) { string[] fileArray = System.IO.Directory.GetFiles(location).Where(n => n.EndsWith(".s3db")).ToArray(); int current = 0; foreach (var path in fileArray) { /*Ha van olyan fájl aminek 0 bájt a méretet akkor azt nem listázzuk */ if (new System.IO.FileInfo(path).Length != 0) { LogFileItem log = new LogFileItem(path); log.ProgressChanged += OnProgressChanged; this.Add(log); } else { Console.WriteLine("Invalid Database file" + path); } OnProgressChanged(this, new ProgressChangedEventArgs((int)((++current / (double)fileArray.Length) * 100.0), "Log Loading:" + System.IO.Path.GetFileName(path) + " ...")); } OnProgressChanged(this, new ProgressChangedEventArgs(100, "Log Loading Complete...")); } }
/// <summary> /// Konstruktor új log létrehozásához. /// </summary> public LogFileItem(string location, string projectName, string fileName) { var path = GetNewPath(location, projectName, fileName); SQLiteConnection.CreateFile(path); var item = new LogFileItem(path); _connection = new LogFileConnection(path); Statistics = new LogFileMessageStatistics(_connection); Messages = new LogFileMessageCollection(_connection, Statistics); Info = new LogFileInfo(_connection); item.Messages.Create(); item.Info.Create(); item.Info.Init(); }