//
        public LevelContentResourceDownloadManager(IDownloadService downloadService, IBaseModule module, IContentResourceServcie resourceService, IConstants constants)
        {
            this.downloadService = downloadService;
            this.levelContentResourceService = resourceService;
            this.constants = constants;

            this.Level = module as Level;

            var filePath = string.Format(@"level_{0}\{1}\Level_{2}.json", this.Level.Id, this.constants.CultureCode, this.Level.Id);
            this.savePath = this.constants.LocalContentPath + filePath;

            this.ResourceList = new List<MapfileItem>();

            MapfileItem f = new MapfileItem();
            f.FileName = filePath;

            this.ResourceList.Add(f);
        }
        public MediaResourceDownloadManager(IDownloadService downloadService, IBaseModule module, IContentResourceServcie activityContentResourceService, IConstants constants)
        {
            this.downloadService = downloadService;
            this.baseModule = module;
            this.constants = constants;
            this.activityContentResourceService = activityContentResourceService;

            string oriContent = this.activityContentResourceService.Content;
            mediaList = ContentHelper.GetMediaResources(ref oriContent);

            this.ResourceList = new List<MapfileItem>();

            // Build ResourceList for Mapfile.
            foreach (var m in mediaList)
            {
                MapfileItem f = new MapfileItem();
                f.FileName = m;
                ResourceList.Add(f);
            }
        }
Ejemplo n.º 3
0
 public void AddFile(MapfileItem file)
 {
     this.Files.Add(file);
 }
        private void BuildDownloadResource()
        {
            this.savePath = this.constants.LocalContentPath + @"{0}_{1}" + @"\" + this.constants.CultureCode + @"\Unit_" + this.Unit.Id + ".json";

            switch (this.constants.ContentGenerateBy)
            {
                case LevelType.Level:
                    // activity, step, lesson, unit, level.
                    this.baseModelId = this.Unit.ParentModule.Id;
                    this.savePath = string.Format(savePath, "level", this.baseModelId);
                    break;
            }

            // Add download path to
            MapfileItem f = new MapfileItem();
            f.FileName = this.savePath;
            // TODO:: To get SHA like value.
            f.SHA = "2";
            ResourceList.Add(f);
        }
Ejemplo n.º 5
0
 public void AddFile(MapfileItem file)
 {
     this.Files.Add(file);
 }