コード例 #1
0
        private bool GetAllCollections()
        {
            CollectionListResult response = null;
            IEnumerable<Collection> spList = null;
            LocalModels.Collection collection = null;

            response = CallClient(() => Client.Collections.List(), Client.Collections);

            if (response != null)
            {
                if (UseWildcard)
                {
                    spList = response.Collections.Where(col => Wildcard.IsMatch(col.Name));
                }
                else
                {
                    spList = response.Collections;
                }

                if (spList != null && spList.Count() > 0)
                {
                    foreach( Collection c in spList)
                    {
                        collection = new LocalModels.Collection(c);
                        WriteObject(collection);
                    }
                    found = true;
                }
            }

            return found;
        }
コード例 #2
0
        private bool GetCollection(string collectionName)
        {
            CollectionResult response = null;
            LocalModels.Collection collection = null;

            response = CallClient(() => Client.Collections.Get(collectionName), Client.Collections);

            if (response != null)
            {
                collection = new LocalModels.Collection(response.Collection);
                WriteObject(collection);
                found = true;
            }

            return found;
        }