System.Xml.XmlDownloadManager.GetStream C# (CSharp) Méthode

GetStream() private méthode

private GetStream ( Uri uri, ICredentials credentials ) : Stream
uri System.Uri
credentials ICredentials
Résultat Stream
        internal Stream GetStream( Uri uri, ICredentials credentials ) {
            if ( uri.Scheme == "file" ) {
                return new FileStream( uri.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read, 1 );
            }
            else {
                return GetNonFileStream( uri, credentials );
            }
        }

Usage Example

        // Maps a URI to an Object containing the actual resource.
        public override object?GetEntity(Uri absoluteUri, string?role, Type?ofObjectToReturn)
        {
            if (ofObjectToReturn is null || ofObjectToReturn == typeof(System.IO.Stream) || ofObjectToReturn == typeof(object))
            {
                return(XmlDownloadManager.GetStream(absoluteUri, _credentials, _proxy));
            }

            throw new XmlException(SR.Xml_UnsupportedClass, string.Empty);
        }
All Usage Examples Of System.Xml.XmlDownloadManager::GetStream