Search options for getting Microsoft Azure add on.
        public override bool Equals(object obj)
        {
            AddOnSearchOptions rhs = obj as AddOnSearchOptions;

            if (rhs == null)
            {
                return(false);
            }

            return
                (GeneralUtilities.TryEquals(this.Name, rhs.Name) &&
                 GeneralUtilities.TryEquals(this.Provider, rhs.Provider) &&
                 GeneralUtilities.TryEquals(this.GeoRegion, rhs.GeoRegion));
        }
Пример #2
0
        /// <summary>
        /// Gets add ons based on the passed filter.
        /// </summary>
        /// <param name="searchOptions">The add on search options</param>
        /// <returns>The list of filtered add ons</returns>
        public virtual List <WindowsAzureAddOn> GetAddOn(AddOnSearchOptions searchOptions = null)
        {
            List <WindowsAzureAddOn> addOns = new List <WindowsAzureAddOn>();
            List <CloudServiceListResponse.CloudService> storeServices = GetStoreCloudServices();

            foreach (CloudServiceListResponse.CloudService storeService in storeServices)
            {
                if (GeneralUtilities.TryEquals(searchOptions.GeoRegion, storeService.GeoRegion))
                {
                    foreach (Resource resource in storeService.Resources)
                    {
                        if (GeneralUtilities.TryEquals(searchOptions.Name, resource.Name) &&
                            GeneralUtilities.TryEquals(searchOptions.Provider, resource.Namespace))
                        {
                            addOns.Add(new WindowsAzureAddOn(resource, storeService.GeoRegion, storeService.Name));
                        }
                    }
                }
            }

            return(addOns);
        }
Пример #3
0
        /// <summary>
        /// Gets add ons based on the passed filter.
        /// </summary>
        /// <param name="searchOptions">The add on search options</param>
        /// <returns>The list of filtered add ons</returns>
        public virtual List<WindowsAzureAddOn> GetAddOn(AddOnSearchOptions searchOptions = null)
        {
            List<WindowsAzureAddOn> addOns = new List<WindowsAzureAddOn>();
            List<CloudServiceListResponse.CloudService> storeServices = GetStoreCloudServices();

            foreach (CloudServiceListResponse.CloudService storeService in storeServices)
            {
                if (GeneralUtilities.TryEquals(searchOptions.GeoRegion, storeService.GeoRegion))
                {
                    foreach (Resource resource in storeService.Resources)
                    {
                        if (GeneralUtilities.TryEquals(searchOptions.Name, resource.Name) &&
                            GeneralUtilities.TryEquals(searchOptions.Provider, resource.Namespace))
                        {
                            addOns.Add(new WindowsAzureAddOn(resource, storeService.GeoRegion, storeService.Name));
                        }
                    }
                }
            }

            return addOns;
        }