public bool SearchContainer(string ContainerName) { if (string.IsNullOrEmpty(ContainerName)) { throw new System.ArgumentException("ContainerName cannot be empty."); } bool Result = false; IEnumerable <ConoHaNet.Objects.Container> ContainerList = ConoHa.ListContainers(); if ((ContainerList != null) && ContainerList.Count() > 0) { foreach (var entry in ContainerList) { if (entry.Name == ContainerName) { Result = true; break; } } } return(Result); }
public System.Collections.Generic.IEnumerable <MyApplication.Objects.Container> GetContainers() { IEnumerable <ConoHaNet.Objects.Container> ContainerList = ConoHa.ListContainers(); List <MyApplication.Objects.Container> Result = null; if ((ContainerList != null) && ContainerList.Count() > 0) { Result = new List <MyApplication.Objects.Container>(ContainerList.Count()); foreach (var entry in ContainerList) { Result.Add(new MyApplication.Objects.Container(entry.Name, entry.Count, entry.Bytes)); } } return(Result); }