Exemplo n.º 1
0
        private bool _CanSaveGrandFather(IFileWriter writer, string altPath = "", float altTime = 0f)
        {
            var grandfatherTime  = TimeToSaveGrandFather;
            var timeDiff         = DateTime.UtcNow - writer.GetLastWriteTimeUTC(altPath);
            var timeCreationDiff = DateTime.UtcNow - writer.GetCreationTimeUTC(altPath);

            if (this._IsInCreationTime(timeCreationDiff.TotalSeconds)) //to write just after creation some values
            {
                return(true);
            }

            return(this._HasMinRunTime(altTime) && timeDiff.TotalSeconds > grandfatherTime.TotalSeconds);
        }