Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- Popup.cs
- ViewStateException.cs
- RadioButton.cs
- XmlDigitalSignatureProcessor.cs
- WindowsPen.cs
- ExpressionVisitor.cs
- EnumBuilder.cs
- RepeaterItemEventArgs.cs
- JulianCalendar.cs
- SqlNotificationEventArgs.cs
- ConvertEvent.cs
- PopupRootAutomationPeer.cs
- DataGridViewCellParsingEventArgs.cs
- SocketAddress.cs
- PopupRootAutomationPeer.cs
- recordstate.cs
- XmlNodeChangedEventManager.cs
- ActivityExecutionContextCollection.cs
- AggregateNode.cs
- GlyphInfoList.cs
- ParameterModifier.cs
- DBSqlParserTableCollection.cs
- SweepDirectionValidation.cs
- Zone.cs
- MenuBindingsEditor.cs
- AspNetHostingPermission.cs
- FacetEnabledSchemaElement.cs
- State.cs
- UpdateProgress.cs
- SchemaNamespaceManager.cs
- ReadonlyMessageFilter.cs
- PerspectiveCamera.cs
- HostedTcpTransportManager.cs
- EpmSourceTree.cs
- WSHttpBinding.cs
- ipaddressinformationcollection.cs
- Material.cs
- ListBox.cs
- UnaryNode.cs
- UnsafeNativeMethods.cs
- XsdDataContractImporter.cs
- ModelUIElement3D.cs
- PenLineJoinValidation.cs
- LinkClickEvent.cs
- HttpGetServerProtocol.cs
- KeyValueConfigurationCollection.cs
- XamlVector3DCollectionSerializer.cs
- XsdBuildProvider.cs
- FixedSOMFixedBlock.cs
- SectionInformation.cs
- EventHandlerService.cs
- SemanticTag.cs
- ChannelReliableSession.cs
- GrammarBuilderDictation.cs
- NameObjectCollectionBase.cs
- MouseBinding.cs
- RegisteredHiddenField.cs
- WorkItem.cs
- TextPatternIdentifiers.cs
- NetDataContractSerializer.cs
- TableLayoutPanelDesigner.cs
- LoggedException.cs
- Environment.cs
- OleDbFactory.cs
- TextLineBreak.cs
- BufferedGraphicsContext.cs
- ImageDrawing.cs
- SqlExpressionNullability.cs
- DSASignatureFormatter.cs
- LinkUtilities.cs
- _NtlmClient.cs
- BooleanAnimationBase.cs
- RepeaterItemCollection.cs
- BackEase.cs
- FastEncoderStatics.cs
- ScrollEvent.cs
- OverrideMode.cs
- LayoutTable.cs
- OpacityConverter.cs
- ReceiveContextCollection.cs
- DbParameterCollectionHelper.cs
- Point3D.cs
- ConfigDefinitionUpdates.cs
- LinearKeyFrames.cs
- CommonRemoteMemoryBlock.cs
- FixedTextView.cs
- GetPageCompletedEventArgs.cs
- RestClientProxyHandler.cs
- Int64Storage.cs
- RestrictedTransactionalPackage.cs
- MouseEventArgs.cs
- DbConvert.cs
- ExpressionBuilderCollection.cs
- FontFamily.cs
- DesignTimeParseData.cs
- IntermediatePolicyValidator.cs
- SemaphoreSecurity.cs
- ConfigXmlWhitespace.cs
- CodeNamespaceImport.cs
- Validator.cs