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
- BamlBinaryReader.cs
- Material.cs
- EditorPart.cs
- CodeStatement.cs
- Section.cs
- ConstrainedGroup.cs
- WebPartCollection.cs
- Itemizer.cs
- VisualStyleElement.cs
- TableLayoutPanelCellPosition.cs
- DateTimePicker.cs
- documentsequencetextcontainer.cs
- ObjectKeyFrameCollection.cs
- FileCodeGroup.cs
- CompositeCollectionView.cs
- QuadraticBezierSegment.cs
- SystemWebSectionGroup.cs
- PointIndependentAnimationStorage.cs
- AnimatedTypeHelpers.cs
- DataGridViewColumnTypePicker.cs
- QueueProcessor.cs
- OleDbDataAdapter.cs
- PersonalizationDictionary.cs
- HtmlInputFile.cs
- WorkflowServiceHost.cs
- DelegatingTypeDescriptionProvider.cs
- MemberInfoSerializationHolder.cs
- ProfileManager.cs
- ReferentialConstraint.cs
- DataGridItem.cs
- Control.cs
- TemplateControlBuildProvider.cs
- GifBitmapEncoder.cs
- basenumberconverter.cs
- ClientSettingsStore.cs
- TypeLoadException.cs
- LinearKeyFrames.cs
- MetadataSerializer.cs
- HtmlInputButton.cs
- TypeUnloadedException.cs
- JsonSerializer.cs
- DomainLiteralReader.cs
- TcpStreams.cs
- SqlUserDefinedAggregateAttribute.cs
- wmiutil.cs
- DashStyles.cs
- InvalidProgramException.cs
- CreateDataSourceDialog.cs
- IdentityNotMappedException.cs
- SessionState.cs
- CacheMemory.cs
- HttpCapabilitiesBase.cs
- BuildProvidersCompiler.cs
- CustomSignedXml.cs
- DependentList.cs
- Utility.cs
- DefaultPerformanceCounters.cs
- ParseNumbers.cs
- AutomationElement.cs
- SmiEventSink.cs
- VisualBrush.cs
- XmlSerializerFactory.cs
- SqlConnectionStringBuilder.cs
- SessionStateModule.cs
- StrokeNodeOperations.cs
- HttpValueCollection.cs
- MsmqBindingElementBase.cs
- EntityExpressionVisitor.cs
- SizeConverter.cs
- UnsafeNativeMethods.cs
- WebPartConnectionsCancelVerb.cs
- EventLogger.cs
- TimeManager.cs
- CodeAttachEventStatement.cs
- LogicalExpr.cs
- RuntimeHelpers.cs
- ServiceModelEnumValidatorAttribute.cs
- DataSvcMapFileSerializer.cs
- RequestNavigateEventArgs.cs
- XmlIncludeAttribute.cs
- WebRequestModuleElement.cs
- ImplicitInputBrush.cs
- HttpsChannelFactory.cs
- BitmapPalettes.cs
- XmlFormatReaderGenerator.cs
- InfoCardAsymmetricCrypto.cs
- SevenBitStream.cs
- Converter.cs
- mediaeventshelper.cs
- UInt32Converter.cs
- XmlObjectSerializer.cs
- basevalidator.cs
- OledbConnectionStringbuilder.cs
- ExceptionUtility.cs
- WebPartConnectionsEventArgs.cs
- ParsedRoute.cs
- StateManagedCollection.cs
- DataGridViewTextBoxColumn.cs
- BaseParser.cs
- OutOfProcStateClientManager.cs