Example #1
0
        private static IUploadStrategy _iuploadstrategy = null;//上传策略

        static BSPUpload()
        {
            try
            {
                string[] fileNameList = Directory.GetFiles(System.Web.HttpRuntime.BinDirectory, "OWZX.UploadStrategy.*.dll", SearchOption.TopDirectoryOnly);
                _iuploadstrategy = (IUploadStrategy)Activator.CreateInstance(Type.GetType(string.Format("OWZX.UploadStrategy.{0}.UploadStrategy, OWZX.UploadStrategy.{0}", fileNameList[0].Substring(fileNameList[0].IndexOf("UploadStrategy.") + 15).Replace(".dll", "")),
                                                                                          false,
                                                                                          true));
            }
            catch
            {
                throw new BSPException("创建'上传策略对象'失败,可能存在的原因:未将'上传策略程序集'添加到bin目录中;'上传策略程序集'文件名不符合'OWZX.UploadStrategy.{策略名称}.dll'格式");
            }
        }
Example #2
0
 public Uploader(IUploadStrategy strategy)
 {
     _strategy = strategy;
 }
Example #3
0
 public void SetUploadingStrategy(IUploadStrategy uploadStrategy)
 {
     this.uploadStrategy = uploadStrategy;
 }
Example #4
0
 public UploaderController(IWorkContext workContext,
                           IUploadStrategy uploadStrategy)
     : base(workContext)
 {
     this.uploadStrategy = uploadStrategy;
 }
Example #5
0
 public ElasticSearchDataClient(IUploadStrategy uploadStrategy)
 {
     this.uploadStrategy = uploadStrategy;
 }