Exemplo n.º 1
0
 /// <summary>
 /// Building webResult from <see cref="cacheResponse"/>
 /// </summary>
 /// <param name="__response">The response.</param>
 public webResult(cacheResponse __response)
 {
     _byteSize = System.Text.ASCIIEncoding.Unicode.GetByteCount(__response.content);
     document.deploySource(__response.content, enums.webRequestActionType.localFile);
     response = __response.httpContent;
     request  = new webRequestFile(response.responseUrl, enums.webRequestActionType.localFile);
 }
        /// <summary>
        /// Kreira novi Request
        /// </summary>
        /// <param name="__url"></param>
        /// <param name="__action"></param>
        /// <param name="__type"></param>
        /// <returns></returns>
        public static webRequest createNewRequest(String __url,
                                                  webRequestActionType __action = webRequestActionType.openUrl,
                                                  webRequestType __type         = webRequestType.unknown)
        {
            webRequest output = null;

            if (__type == webRequestType.unknown)
            {
                __type = webRequestBase.getPreference(__action);
            }

            switch (__type)
            {
            case webRequestType.webRequestBrowser:
                output = new webRequestBrowser(__url, __action);
                break;

            case webRequestType.webRequestClient:
                output = new webRequestClient(__url, __action);
                break;

            case webRequestType.webRequestLookup:
                output = new webRequestLookup(__url, __action);
                break;

            case webRequestType.webRequestFile:
                output = new webRequestFile(__url, __action);
                break;

            default:
                break;
            }

            return(output);
        }