Beispiel #1
0
        private bool TryGetLatestRevisionNumber(string name, IStorageActionsAccessor accessor, out int latestRevision)
        {
            int?latest = null;

            foreach (var file in accessor.GetFilesStartingWith(name + "/revisions/", 0, int.MaxValue))
            {
                var revisionNum = file.Name;
                int revision;
                if (int.TryParse(revisionNum, out revision))
                {
                    if (latest == null || revision > latest)
                    {
                        latest = revision;
                    }
                }
            }

            if (latest != null)
            {
                latestRevision = latest.Value;
                return(true);
            }

            latestRevision = -1;
            return(false);
        }
 private FileHeader GetLatestRevisionsFile(string name, IStorageActionsAccessor accessor)
 {
     return(accessor
            .GetFilesStartingWith(name + "/revisions/", 0, int.MaxValue)
            .LastOrDefault());
 }
		private static FileHeader GetLatestRevisionsFile(string name, IStorageActionsAccessor accessor)
		{
			return accessor
				.GetFilesStartingWith(name + "/revisions/", 0, int.MaxValue)
				.LastOrDefault();
		}