Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Xml / System / Xml / XmlUrlResolver.cs / 1 / XmlUrlResolver.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml { using System; using System.IO; using System.Net; using System.Threading; using System.Security.Permissions; using System.Security.Policy; using System.Security; ////// /// public class XmlUrlResolver : XmlResolver { static object s_DownloadManager; ICredentials _credentials; static XmlDownloadManager DownloadManager { get { if ( s_DownloadManager == null ) { object dm = new XmlDownloadManager(); Interlocked.CompareExchange( ref s_DownloadManager, dm, null ); } return (XmlDownloadManager)s_DownloadManager; } } // Construction ///Resolves external XML resources named by a /// Uniform Resource Identifier (URI). ////// /// public XmlUrlResolver() { } //UE attension ////// Creates a new instance of the XmlUrlResolver class. /// ////// /// public override ICredentials Credentials { set { _credentials = value; } } // Resource resolution ///[To be supplied.] ////// /// public override Object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) { if (ofObjectToReturn == null || ofObjectToReturn == typeof(System.IO.Stream)) { return DownloadManager.GetStream(absoluteUri, _credentials); } else { throw new XmlException(Res.Xml_UnsupportedClass, string.Empty); } } ///Maps a /// URI to an Object containing the actual resource. ////// /// [PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")] public override Uri ResolveUri(Uri baseUri, string relativeUri){ return base.ResolveUri(baseUri, relativeUri); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //[To be supplied.] ///// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //----------------------------------------------------------------------------- namespace System.Xml { using System; using System.IO; using System.Net; using System.Threading; using System.Security.Permissions; using System.Security.Policy; using System.Security; ////// /// public class XmlUrlResolver : XmlResolver { static object s_DownloadManager; ICredentials _credentials; static XmlDownloadManager DownloadManager { get { if ( s_DownloadManager == null ) { object dm = new XmlDownloadManager(); Interlocked.CompareExchange( ref s_DownloadManager, dm, null ); } return (XmlDownloadManager)s_DownloadManager; } } // Construction ///Resolves external XML resources named by a /// Uniform Resource Identifier (URI). ////// /// public XmlUrlResolver() { } //UE attension ////// Creates a new instance of the XmlUrlResolver class. /// ////// /// public override ICredentials Credentials { set { _credentials = value; } } // Resource resolution ///[To be supplied.] ////// /// public override Object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) { if (ofObjectToReturn == null || ofObjectToReturn == typeof(System.IO.Stream)) { return DownloadManager.GetStream(absoluteUri, _credentials); } else { throw new XmlException(Res.Xml_UnsupportedClass, string.Empty); } } ///Maps a /// URI to an Object containing the actual resource. ////// /// [PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")] public override Uri ResolveUri(Uri baseUri, string relativeUri){ return base.ResolveUri(baseUri, relativeUri); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.[To be supplied.] ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- User.cs
- RuleConditionDialog.cs
- DiffuseMaterial.cs
- StorageEndPropertyMapping.cs
- WindowsStartMenu.cs
- MessageRpc.cs
- SerialPort.cs
- Model3DCollection.cs
- XPathNodePointer.cs
- DelayLoadType.cs
- HandoffBehavior.cs
- Schema.cs
- StylusPointPropertyUnit.cs
- FlowPanelDesigner.cs
- CharacterString.cs
- ObjectDataSourceEventArgs.cs
- ApplicationCommands.cs
- RegistrationServices.cs
- Material.cs
- RepeatInfo.cs
- Transform3D.cs
- TypeTypeConverter.cs
- WebBrowserNavigatingEventHandler.cs
- LoginView.cs
- ImageInfo.cs
- ConfigXmlAttribute.cs
- SR.cs
- MaskInputRejectedEventArgs.cs
- basenumberconverter.cs
- ToolBarButton.cs
- Config.cs
- NamespaceImport.cs
- MSAANativeProvider.cs
- ObservableDictionary.cs
- _NetworkingPerfCounters.cs
- TextEditorCharacters.cs
- ValueProviderWrapper.cs
- WebPageTraceListener.cs
- HotSpotCollectionEditor.cs
- BuilderPropertyEntry.cs
- SoapSchemaMember.cs
- SafeProcessHandle.cs
- ClientData.cs
- CompilerWrapper.cs
- AppManager.cs
- XmlEncoding.cs
- CurrencyManager.cs
- XsltLibrary.cs
- CodeCatchClause.cs
- ConfigurationStrings.cs
- SharedUtils.cs
- ServiceX509SecurityTokenProvider.cs
- FilterUserControlBase.cs
- ObjectCloneHelper.cs
- ApplicationSecurityManager.cs
- GridViewRow.cs
- PhysicalAddress.cs
- ParameterElement.cs
- MessageContractMemberAttribute.cs
- ObjectHandle.cs
- counter.cs
- FileSecurity.cs
- DesignerValidationSummaryAdapter.cs
- TimeStampChecker.cs
- BitmapEffectDrawing.cs
- SqlTriggerContext.cs
- ClientUrlResolverWrapper.cs
- HttpClientCertificate.cs
- SplineKeyFrames.cs
- DesignTimeVisibleAttribute.cs
- FatalException.cs
- GroupBoxRenderer.cs
- CryptoProvider.cs
- UrlPath.cs
- PropertyNames.cs
- RequestCacheValidator.cs
- MetadataArtifactLoaderCompositeResource.cs
- WebPartConnectionsDisconnectVerb.cs
- SocketAddress.cs
- ImageMap.cs
- Misc.cs
- BrowsableAttribute.cs
- SqlError.cs
- CellParagraph.cs
- TokenCreationParameter.cs
- TableHeaderCell.cs
- CodeSnippetTypeMember.cs
- Compiler.cs
- ExceptionRoutedEventArgs.cs
- BrowsableAttribute.cs
- IdentifierCollection.cs
- QilLoop.cs
- ToolStripPanelCell.cs
- X509Certificate.cs
- BulletDecorator.cs
- DefaultBindingPropertyAttribute.cs
- SubstitutionResponseElement.cs
- TemplateDefinition.cs
- ClientScriptManager.cs
- ImageFormat.cs