public ResourceUrlFactory(IResourcePathBuilder builder, ResourceTheme resourceTheme)
 {
     ArgumentUtility.CheckNotNull("builder", builder);
     ArgumentUtility.CheckNotNull("resourceTheme", resourceTheme);
     _builder       = builder;
     _resourceTheme = resourceTheme;
 }
Exemplo n.º 2
0
        public ResourceService()
        {
            string accessKeyId     = ConfigurationManager.AppSettings["oss_key_id"];
            string accessKeySecret = ConfigurationManager.AppSettings["oss_key_secret"];
            string format          = ConfigurationManager.AppSettings["oss_host"];
            string root            = ConfigurationManager.AppSettings["oss_root"];

            _publicBucket = ConfigurationManager.AppSettings["oss_public_bucket"];
            string host = string.Format(format, _publicBucket);

            _privateBucket = ConfigurationManager.AppSettings["oss_private_bucket"];
            string privateHost = string.Format(format, _privateBucket);

            _publicStorage  = new AliOssStorage(accessKeyId, accessKeySecret, _publicBucket, host, root);
            _privateStorage = new AliOssStorage(accessKeyId, accessKeySecret, _privateBucket, privateHost, root);
            _pathBuilder    = new AccurateToHourPathBuilder();
            _publicHost     = ConfigurationManager.AppSettings["resource_public_host"];
            if (string.IsNullOrWhiteSpace(_publicHost))
            {
                _publicHost = _publicStorage.Host;
            }
            _privateHost = ConfigurationManager.AppSettings["resource_private_host"];
            if (string.IsNullOrWhiteSpace(_privateHost))
            {
                _privateHost = _privateStorage.Host;
            }
            _privateWatermarkHost = ConfigurationManager.AppSettings["watermark_host"];
        }
        protected ResourceObjectBase(IResourcePathBuilder resourcePathBuilder, Assembly assembly)
        {
            ArgumentUtility.CheckNotNull("resourcePathBuilder", resourcePathBuilder);
            ArgumentUtility.CheckNotNull("assembly", assembly);

            _resourceRoot = resourcePathBuilder.BuildAbsolutePath(assembly);
        }
Exemplo n.º 4
0
        public ResourceUrl(IResourcePathBuilder resourcePathBuilder, Type definingType, ResourceType resourceType, string relativeUrl)
        {
            ArgumentUtility.CheckNotNull("resourcePathBuilder", resourcePathBuilder);
            ArgumentUtility.CheckNotNull("definingType", definingType);
            ArgumentUtility.CheckNotNull("resourceType", resourceType);
            ArgumentUtility.CheckNotNullOrEmpty("relativeUrl", relativeUrl);

            _resourcePathBuilder = resourcePathBuilder;
            _definingType        = definingType;
            _resourceType        = resourceType;
            _relativeUrl         = relativeUrl;
        }
Exemplo n.º 5
0
 public ResourceObject(IResourcePathBuilder resourcePathBuilder, Assembly assembly, string path)
     : base(resourcePathBuilder, assembly)
 {
     ArgumentUtility.CheckNotNullOrEmpty("path", path);
     _path = path;
 }
Exemplo n.º 6
0
 public ResourceObjectWithVarRef(IResourcePathBuilder resourcePathBuilder, Assembly assembly, WxeVariableReference pathReference)
     : base(resourcePathBuilder, assembly)
 {
     ArgumentUtility.CheckNotNull("pathReference", pathReference);
     _pathReference = pathReference;
 }
        public QuirksModeResourceUrlFactory(IResourcePathBuilder builder)
        {
            ArgumentUtility.CheckNotNull("builder", builder);

            _builder = builder;
        }