Пример #1
0
 /// <summary>
 /// Creates a new <see cref="ExternalStreamWrapper"/> with the given proxy object.
 /// </summary>
 /// <param name="proxy">Instance of a class derived from <see cref="MarshalByRefObject"/> that should
 /// serve as a proxy for this <see cref="ExternalStreamWrapper"/>.</param>
 /// <param name="scheme">The protocol portion of URL handled by this wrapper.</param>
 protected ExternalStreamWrapper(IExternalStreamWrapper proxy, string scheme)
 {
     this.proxy  = proxy;
     this.scheme = scheme;
 }
Пример #2
0
        /// <summary>
        /// Tries to find an <see cref="ExternalStreamWrapper"/> a given <paramref name="scheme"/>.
        /// </summary>
        /// <param name="scheme">The scheme portion of an URL.</param>
        /// <returns>An <see cref="ExternalStreamWrapper"/> associated with the given <paramref name="scheme"/>
        /// or <c>null</c> if the wrapper was not found.</returns>
        public static ExternalStreamWrapper GetExternalWrapperByScheme(string scheme)
        {
            IExternalStreamWrapper proxy = Externals.GetStreamWrapper(scheme);

            return(proxy == null ? null : new ExternalStreamWrapper(proxy, scheme));
        }