IsValid() публичный статический Метод

public static IsValid ( string compressionType ) : bool
compressionType string
Результат bool
Пример #1
0
        public CompressedFileResult(string filePath, string compressionType, string contentMimeType)
        {
            if (!CompressionTypes.IsValid(compressionType))
            {
                throw new ArgumentException(@"Must be either 'deflate' or 'gzip'", compressionType);
            }

            this.FilePath = filePath;
            this.Headers  = new Dictionary <string, string> {
                { HttpHeaders.ContentType, contentMimeType },
                { HttpHeaders.ContentEncoding, compressionType },
            };
        }
Пример #2
0
        public CompressedResult(byte[] contents, string compressionType, string contentMimeType)
        {
            if (!CompressionTypes.IsValid(compressionType))
            {
                throw new ArgumentException("Must be either 'deflate' or 'gzip'", compressionType);
            }

            this.StatusCode  = HttpStatusCode.OK;
            this.ContentType = contentMimeType;

            this.Contents = contents;
            this.Headers  = new Dictionary <string, string> {
                { HttpHeaders.ContentEncoding, compressionType },
            };
        }