Beispiel #1
0
        public void CreateCopy(string text)
        {
            var _ = new AppDataFile(CompanyName, CopiesSubFolder,
                                    $"{Path.GetFileNameWithoutExtension(FileName)}_{DateTime.Now:MM_dd_yyyy_hh_mm_ss_tt}{Path.GetExtension(FileName)}")
            {
                FileData = text
            };

            new AppDataFolder(CompanyName, CopiesSubFolder)
            .Files
            .OrderByDescending(File.GetLastWriteTimeUtc)
            .Skip(MaxCopiesCount)
            .AsParallel()
            .ForAll(File.Delete);
        }
Beispiel #2
0
 public CommandsHistory(string companyName)
 {
     CompanyName = companyName;
     AppDataFile = new AppDataFile(CompanyName, FileName);
 }
Beispiel #3
0
 public CommandsStorage(string companyName, int maxCopiesCount = 50)
 {
     CompanyName    = companyName;
     MaxCopiesCount = maxCopiesCount;
     AppDataFile    = new AppDataFile(CompanyName, FileName);
 }