Esempio n. 1
0
        public ISynoCSVReportPair GetReport(DateTime ts, SynoReportType first, SynoReportType second)
        {
            ISynoCSVReportPair result = null;

            DownloadUpdate?.Invoke(this, new SynoReportCacheDownloadEventArgs(CacheStatus.Processing));
            if (_allreports.ContainsKey(ts))
            {
                if (_allreports[ts].ContainsKey(first) && _allreports[ts].ContainsKey(second))
                {
                    switch ((1 + (int)first) * (1 + (int)second))
                    {
                    case ((1 + (int)SynoReportType.ShareList) * (1 + (int)SynoReportType.VolumeUsage)):
                    {
                        result = new SynoReportVolumePieData(GetReport(ts, first), GetReport(ts, second));
                    }
                    break;

                    default:
                        break;
                    }
                }
            }
            DownloadUpdate?.Invoke(this, new SynoReportCacheDownloadEventArgs(CacheStatus.Idle));
            return(result);
        }
Esempio n. 2
0
 public void ScanCachedReports()
 {
     DownloadUpdate?.Invoke(this, new SynoReportCacheDownloadEventArgs(CacheStatus.Processing));
     foreach (FileInfo local in new DirectoryInfo(Path).GetFiles())
     {
         CSVToCategory(local);
     }
     DownloadUpdate?.Invoke(this, new SynoReportCacheDownloadEventArgs(CacheStatus.Idle));
 }
Esempio n. 3
0
        public ISynoCSVReport GetReport(ICachedReportFile file)
        {
            DownloadUpdate?.Invoke(this, new SynoReportCacheDownloadEventArgs(CacheStatus.Processing));
            ISynoCSVReport report = null;

            switch (file.Type)
            {
            case SynoReportType.DuplicateCandidates:
                report = SynoCSVReader <SynoReportDuplicateCandidates> .LoadReport(file.LocalFile);

                break;

            case SynoReportType.VolumeUsage:
                report = SynoCSVReader <SynoReportVolumeUsageValues> .LoadReport(file.LocalFile);

                break;

            case SynoReportType.ShareList:
                report = SynoCSVReader <SynoReportSharesValues> .LoadReport(file.LocalFile);

                break;

            case SynoReportType.LargeFiles:
            case SynoReportType.LeastModified:
            case SynoReportType.MostModified:
                report = SynoCSVReader <SynoReportFileDetails> .LoadReport(file.LocalFile);

                break;

            case SynoReportType.FileGroup:
                report = SynoCSVReader <SynoReportGroups> .LoadReport(file.LocalFile);

                break;

            case SynoReportType.FileOwner:
                report = SynoCSVReader <SynoReportOwners> .LoadReport(file.LocalFile);

                break;

            default:
            {
                report = SynoCSVReader <SynoReportContents> .LoadReport(file.LocalFile);

                break;
            }
            }
            DownloadUpdate?.Invoke(this, new SynoReportCacheDownloadEventArgs(CacheStatus.Idle));
            return(report);
        }
Esempio n. 4
0
        public ISynoCSVReport GetReport(DateTime ts, SynoReportType type)
        {
            ISynoCSVReport result = null;

            DownloadUpdate?.Invoke(this, new SynoReportCacheDownloadEventArgs(CacheStatus.Processing));
            if (_allreports.ContainsKey(ts))
            {
                if (_allreports[ts].ContainsKey(type))
                {
                    result = GetReport(_allreports[ts][type]);
                }
            }
            DownloadUpdate?.Invoke(this, new SynoReportCacheDownloadEventArgs(CacheStatus.Idle));
            return(result);
        }
Esempio n. 5
0
 protected void OnDownloadUpdate(object sender, SynoReportCacheDownloadEventArgs e)
 {
     DownloadUpdate?.Invoke(sender, e);
 }