예제 #1
0
        public virtual void ConvertFile(Stream inStream, string fileName, Stream outStream, bool compressRequest)
        {
            byte[] data = new byte[inStream.Length];
            inStream.Read(data, 0, data.Length);
            inStream.Close();

            /*            if (!PostParameters.ContainsKey("OutputFileName"))
            *               SetOutputFileName(Path.GetFileNameWithoutExtension(fileName));*/

            PostParameters.Add("file", new FormUpload.FileParameter(data, fileName, Helpers.GetMimeType(fileName)));

            Convert(PostParameters, outStream, compressRequest);
        }
예제 #2
0
        public override void AnalyzeRequestResponse(string page)
        {
            base.AnalyzeRequestResponse(page);

            // Loop through language options in the page to see the one's requested
            for (int i = 0; i < 100; i++)
            {
                string languageValue = Utilities.ReadInputFieldById(page, string.Format("ctl00_PlaceHolderMain_MUISettings_AlternateLanguagesSection_ctlSelectLanguages_CblAlternateLanguages_{0}", i));
                // leave when empty as we've iterated all supported languages
                if (languageValue.Length == 0)
                {
                    break;
                }

                // If we found one, set that as checked
                if (this.Languages.Contains(int.Parse(languageValue)))
                {
                    PostParameters.Add(string.Format("ctl00$PlaceHolderMain$MUISettings$AlternateLanguagesSection$ctlSelectLanguages$CblAlternateLanguages${0}", i), languageValue);
                }
            }
        }
예제 #3
0
        public virtual void AddFile(string name, string fileName, Stream stream, string contentType, string contentDisposition)
        {
            var parameter = HttpPostParameter.CreateFile(name, fileName, stream, contentType, contentDisposition);

            PostParameters.Add(parameter);
        }
예제 #4
0
        public virtual void AddField(string name, string value)
        {
            var field = new HttpPostParameter(name, value);

            PostParameters.Add(field);
        }