public ProviderController(StoreProviderType providerType, string modulePath) { string providerPath; string virtualPath; string[] folderList; providerList = new ArrayList(); if (!modulePath.EndsWith("\\")) modulePath += "\\"; providerPath = modulePath + providerPaths[(int)providerType]; folderList = Directory.GetDirectories(providerPath); foreach(string folder in folderList) { virtualPath = providerPaths[(int)providerType].Replace("\\", "/"); virtualPath += getTrailingFolder(folder); ProviderInfo providerInfo = getProviderInfo(folder); providerInfo.Path = folder; providerInfo.VirtualPath = virtualPath; providerInfo.Type = providerType; providerList.Add(providerInfo); } }
public ProviderController(StoreProviderType providerType) { _providerList = (List <ProviderInfo>)DataCache.GetCache("StoreProviderList" + providerType); if (_providerList == null) { string providerPath = Path.Combine(System.Web.HttpRuntime.AppDomainAppPath, "DesktopModules\\Store\\"); _providerList = new List <ProviderInfo>(); providerPath = Path.Combine(providerPath, _providerPaths[(int)providerType]); string[] folderList = Directory.GetDirectories(providerPath); foreach (string folder in folderList) { ProviderInfo providerInfo = GetProviderInfo(folder); if (providerInfo != null) { string virtualPath = _providerPaths[(int)providerType].Replace("\\", "/"); virtualPath += GetTrailingFolder(folder); providerInfo.Path = folder; providerInfo.VirtualPath = virtualPath; providerInfo.Type = providerType; _providerList.Add(providerInfo); } } DataCache.SetCache("StoreProviderList" + providerType, _providerList); } }
/// <summary> /// Get the list of installed providers for the specified type. /// </summary> /// <param name="providerType">Type of the provider</param> /// <returns>List of installed providers</returns> public static List <ProviderInfo> GetProviderList(StoreProviderType providerType) { //Initialize a provider controller ProviderController providerController = new ProviderController(providerType); //Get the provider list return(providerController.GetProviders()); }