protected ASCBundle(string virtualPath, params IBundleTransform[] transforms) : base(virtualPath, transforms) { Transforms.Add(new CopyrigthTransform()); if (!BundleTable.Bundles.UseCdn) { return; } bool isCDN = false; var section = (StorageConfigurationSection)WebConfigurationManager.GetSection("storage"); foreach (HandlerConfigurationElement h in section.Handlers) { if (String.Compare(h.Name, "cdn", true) != 0) { continue; } if (h.Type.Equals(typeof(SelectelStorage))) { Transforms.Add(new SelectelStorageTransform()); } else if (h.Type.Equals(typeof(S3Storage))) { Transforms.Add(new CloudFrontTransform()); } else if (h.Type.Equals(typeof(GoogleCloudStorage))) { Transforms.Add(new GoogleCloudStorageTransform()); } else if (h.Type.Equals(typeof(RackspaceCloudStorage))) { Transforms.Add(new RackspaceCloudStorageTransform()); } else { throw new Exception("unknown argument"); } isCDN = true; break; } if (!isCDN) { if (CoreContext.Configuration.Standalone) { Transforms.Add(new DiscTransform()); CdnPath = DiscTransform.GetUri(Path, ContentType); } } }
private string GetLink() { var path = bundleData.GetStorageVirtualPath(ClientSettings.ResetCacheKey); if (DiscTransform.SuccessInitialized && DiscTransform.IsFile(path)) { return(bundleData.GetLink(DiscTransform.GetUri(path), false)); } return(BundleHelper.AddBundle(bundleData)); }
protected ASCBundle(string virtualPath, params IBundleTransform[] transforms) : base(virtualPath, transforms) { Transforms.Add(new CopyrigthTransform()); if (!BundleTable.Bundles.UseCdn) { return; } if (CoreContext.Configuration.Standalone) { Transforms.Add(new DiscTransform()); CdnPath = DiscTransform.GetUri(Path, ContentType); } else { Transforms.Add(new CdnTransform()); } }