Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- TextEncodedRawTextWriter.cs
- ContainsRowNumberChecker.cs
- RowUpdatingEventArgs.cs
- XPathDocument.cs
- BoolLiteral.cs
- WebUtil.cs
- DbConnectionFactory.cs
- CapabilitiesPattern.cs
- UIAgentRequest.cs
- Types.cs
- SingleTagSectionHandler.cs
- WorkflowApplicationTerminatedException.cs
- StringTraceRecord.cs
- InstanceContextManager.cs
- RegistryPermission.cs
- SoapProtocolImporter.cs
- VerificationAttribute.cs
- URLBuilder.cs
- ControlEvent.cs
- securitycriticaldataClass.cs
- BitmapEffectDrawing.cs
- EditorServiceContext.cs
- SrgsGrammarCompiler.cs
- RoleManagerEventArgs.cs
- ApplicationFileParser.cs
- IncrementalReadDecoders.cs
- PointValueSerializer.cs
- DescendantOverDescendantQuery.cs
- PropertyTabChangedEvent.cs
- ConfigXmlText.cs
- GridItemCollection.cs
- VerificationException.cs
- BaseDataBoundControl.cs
- WebPartCollection.cs
- TimeManager.cs
- _BufferOffsetSize.cs
- WebConfigurationManager.cs
- CfgSemanticTag.cs
- DataGridViewEditingControlShowingEventArgs.cs
- DateTimeOffsetConverter.cs
- XmlSiteMapProvider.cs
- VerificationException.cs
- DesignTimeDataBinding.cs
- WebPartAuthorizationEventArgs.cs
- DispatcherOperation.cs
- Keyboard.cs
- MembershipUser.cs
- MenuCommandsChangedEventArgs.cs
- ObfuscationAttribute.cs
- PersonalizationState.cs
- Int16KeyFrameCollection.cs
- SqlTransaction.cs
- XmlQueryCardinality.cs
- ComContractElementCollection.cs
- StylusTip.cs
- UnhandledExceptionEventArgs.cs
- PeerInputChannelListener.cs
- XmlDataCollection.cs
- Transform3DGroup.cs
- PreviewPrintController.cs
- AccessDataSource.cs
- TextEditorTables.cs
- LocalBuilder.cs
- DBConnection.cs
- XmlException.cs
- FederatedMessageSecurityOverHttp.cs
- MethodBuilder.cs
- OleStrCAMarshaler.cs
- MoveSizeWinEventHandler.cs
- ToolStripTextBox.cs
- VScrollProperties.cs
- FixedTextView.cs
- FormsAuthentication.cs
- StreamGeometry.cs
- OracleEncoding.cs
- SQLDouble.cs
- ExportException.cs
- TcpHostedTransportConfiguration.cs
- UpdatePanelTriggerCollection.cs
- XsdDateTime.cs
- GridViewUpdatedEventArgs.cs
- storepermissionattribute.cs
- EventManager.cs
- TimerEventSubscription.cs
- CodeObject.cs
- WorkflowDesignerColors.cs
- ProxyWebPart.cs
- NativeWindow.cs
- DataGridViewTopLeftHeaderCell.cs
- DeobfuscatingStream.cs
- EditorBrowsableAttribute.cs
- IPipelineRuntime.cs
- DateTimeStorage.cs
- XmlWhitespace.cs
- safelinkcollection.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- SortExpressionBuilder.cs
- CallbackValidator.cs
- ImageSource.cs
- QueryStringHandler.cs