Exemple #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));
        }
Exemple #2
0
 /// <summary>
 /// Disposes of the instance.
 /// </summary>
 public void Dispose()
 {
     DynamicUriRegistry.Unregister(this);
 }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        protected DynamicUriAuthority()
        {
            this.id = Guid.NewGuid();

            DynamicUriRegistry.Register(this);
        }