Ejemplo n.º 1
0
        public static BaseFileRequest BuildRequest(string fileName, HttpListenerRequest request)
        {
            var             type = FileTypeSelector.GetFileTypeByName(fileName);
            BaseFileRequest result;

            switch (type)
            {
            case FileType.Default:
                result = new DefaultFileRequest();
                break;

            case FileType.Image:
                result = new ImageRequest();
                break;

            case FileType.Video:
                result = new VideoRequest();
                break;

            default:
                return(null);
            }

            if (!result.BuildRequest(fileName, request))
            {
                return(null);
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static BaseFilePreprocessTask BuildTask(string fileName)
        {
            var type = FileTypeSelector.GetFileTypeByName(fileName);

            switch (type)
            {
            case FileType.Default:
                return(null);

            case FileType.Image:
                return(new ImagePreprocessTask {
                    FileName = fileName
                });

            case FileType.Video:
                return(new VideoPreprocessTask {
                    FileName = fileName
                });

            default:
                return(null);
            }
        }