public static IEnumerable <SimpleServerImage> ListAllImages(IComputeProvider provider, int?blockSize = null, string server = null, string imageName = null, ImageState imageStatus = null, DateTimeOffset?changesSince = null, ImageType imageType = null, string region = null, CloudIdentity identity = null) { if (blockSize <= 0) { throw new ArgumentOutOfRangeException("blockSize"); } SimpleServerImage lastImage = null; do { string marker = lastImage != null ? lastImage.Id : null; IEnumerable <SimpleServerImage> images = provider.ListImages(server, imageName, imageStatus, changesSince, marker, blockSize, imageType, region, identity); lastImage = null; foreach (SimpleServerImage image in images) { lastImage = image; yield return(image); } } while (lastImage != null); }
public static IEnumerable<SimpleServerImage> ListAllImages(IComputeProvider provider, int? blockSize = null, string server = null, string imageName = null, ImageState imageStatus = null, DateTimeOffset? changesSince = null, ImageType imageType = null, string region = null, CloudIdentity identity = null) { if (blockSize <= 0) throw new ArgumentOutOfRangeException("blockSize"); SimpleServerImage lastImage = null; do { string marker = lastImage != null ? lastImage.Id : null; IEnumerable<SimpleServerImage> images = provider.ListImages(server, imageName, imageStatus, changesSince, marker, blockSize, imageType, region, identity); lastImage = null; foreach (SimpleServerImage image in images) { lastImage = image; yield return image; } } while (lastImage != null); }