XmlResolver.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Xml / System / Xml / XmlResolver.cs / 1 / XmlResolver.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
//-----------------------------------------------------------------------------
 
namespace System.Xml 
{
    using System; 
    using System.IO;
    using System.Net;
    using System.Text;
    using System.Security; 
    using System.Security.Policy;
    using System.Security.Permissions; 
 
    /// 
    ///  
    ///    Resolves external XML resources named by a Uniform
    ///       Resource Identifier (URI). This class is 
    ///       .
    ///  
    public abstract class XmlResolver {
        ///  
        ///  
        ///    Maps a
        ///       URI to an Object containing the actual resource. 
        /// 

        public abstract Object GetEntity(Uri absoluteUri,
                                         string role, 
                                         Type ofObjectToReturn);
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public virtual Uri ResolveUri(Uri baseUri, string relativeUri) {
            if ( baseUri == null || ( !baseUri.IsAbsoluteUri && baseUri.OriginalString.Length == 0 ) ) {
                Uri uri = new Uri( relativeUri, UriKind.RelativeOrAbsolute ); 
                if ( !uri.IsAbsoluteUri && uri.OriginalString.Length > 0 ) {
                    uri = new Uri( Path.GetFullPath( relativeUri ) ); 
                } 
                return uri;
            } 
            else {
                if ( relativeUri == null || relativeUri.Length == 0 ) {
                    return baseUri;
                } 
                return new Uri( baseUri, relativeUri );
            } 
        } 

        //UE attension 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public abstract ICredentials Credentials {
            set; 
        } 
    }
} 

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK