System.Runtime.Remoting.MetadataServices.SdlParser.ParseReaderStreamLocation C# (CSharp) Method

ParseReaderStreamLocation() private method

private ParseReaderStreamLocation ( ReaderStream reader ) : void
reader ReaderStream
return void
       private void ParseReaderStreamLocation(ReaderStream reader)
        {
            Util.Log("SdlParser.ParseReaderStreamLocation");            
            String location = reader.Location;
            int index = location.IndexOf(':');
            if(index != -1)
            {
                String protocol = location.Substring(0, index).ToLower(CultureInfo.InvariantCulture);
                String value = location.Substring(index+1);
                if(protocol == "file")
                {
                    //Console.WriteLine("Loading file:" + value);
                    reader.InputStream = new StreamReader(value);
                }
                else if(protocol.StartsWith("http"))
                {
                    //Console.WriteLine("Loading " + protocol + ':' + value);
                    /*

                    // Setup proxy settings
                    DefaultControlObject proxyObject = new DefaultControlObject();
                    proxyObject.ProxyNoLocal = true;
                    GlobalProxySelection.Select = proxyObject;
                    */
                    WebRequest request = WebRequest.Create(location);
                    WebResponse response = request.GetResponse();
                    Stream responseStream = response.GetResponseStream();
                    reader.InputStream = new StreamReader(responseStream);
                }
            }

            return;
        }