Esempio n. 1
0
        public void LoadAllLogs()
        {
            List <LogStub> stubsToAdd    = new List <LogStub>();
            var            loadDirectory = this.Settings.LogFolder;

            var directory = new DirectoryInfo(loadDirectory);
            var files     = directory.GetFiles("*.timelog");

            foreach (var file in files)
            {
                var fileDateByName = file.Name.ToLower().Replace(".timelog", string.Empty).Replace('-', '/');

                DateTime logDate;
                if (!DateTime.TryParse(fileDateByName, out logDate))
                {
                    continue;
                }

                var logStub =
                    new LogStub()
                {
                    FileName = file.FullName,
                    Date     = logDate.Date,
                    Group    = GetGroupByLogDate(logDate.Date)
                };

                stubsToAdd.Add(logStub);
            }

            UIThread.Run(() =>
            {
                this.AllLogs.Clear();
                stubsToAdd.ForEach(x => this.AllLogs.Add(x));
            });
        }
Esempio n. 2
0
        public void LoadAllLogs()
        {
            List<LogStub> stubsToAdd = new List<LogStub>();
              var loadDirectory = this.Settings.LogFolder;

              var directory = new DirectoryInfo(loadDirectory);
              var files = directory.GetFiles("*.timelog");
              foreach (var file in files)
              {
            var fileDateByName = file.Name.ToLower().Replace(".timelog", string.Empty).Replace('-', '/');

            DateTime logDate;
            if (!DateTime.TryParse(fileDateByName, out logDate))
              continue;

            var logStub =
              new LogStub()
              {
            FileName = file.FullName,
            Date = logDate.Date,
            Group = GetGroupByLogDate(logDate.Date)
              };

            stubsToAdd.Add(logStub);
              }

              UIThread.Run(() =>
            {
              this.AllLogs.Clear();
              stubsToAdd.ForEach(x => this.AllLogs.Add(x));
            });
        }