Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        /// <param name="uri"></param>
        public DynamicWebRequest(Uri uri)
            : base()
        {
            Contract.Requires <ArgumentNullException>(uri != null);
            Contract.Requires <ArgumentOutOfRangeException>(uri.Scheme == DynamicUriHelper.UriSchemeDynamic);

            this.uri           = uri;
            this.method        = "GET";
            this.contentLength = 0;
            this.headers       = new WebHeaderCollection();
            this.stream        = new MemoryStream();

            this.response = new Lazy <WebResponse>(() => DynamicUriRegistry.Get(new Guid(RequestUri.Authority)).GetResponse(this));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Disposes of the instance.
 /// </summary>
 public void Dispose()
 {
     DynamicUriRegistry.Unregister(this);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        protected DynamicUriAuthority()
        {
            this.id = Guid.NewGuid();

            DynamicUriRegistry.Register(this);
        }