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
- Manipulation.cs
- UniqueID.cs
- DomNameTable.cs
- RoleGroup.cs
- DbTypeMap.cs
- PropertySourceInfo.cs
- TransformCollection.cs
- CssStyleCollection.cs
- TextServicesHost.cs
- RuntimeConfigurationRecord.cs
- AnimationClock.cs
- MemoryPressure.cs
- Figure.cs
- WebPart.cs
- Compress.cs
- DecimalFormatter.cs
- SafeNativeMethodsOther.cs
- XmlILAnnotation.cs
- XmlMapping.cs
- XsdBuildProvider.cs
- Vector.cs
- CacheDependency.cs
- DataGridViewRowPrePaintEventArgs.cs
- CharacterMetricsDictionary.cs
- InputLangChangeRequestEvent.cs
- DynamicILGenerator.cs
- EndSelectCardRequest.cs
- AggregateNode.cs
- Attachment.cs
- ColorMap.cs
- ToolStripItemEventArgs.cs
- XmlBinaryWriterSession.cs
- PolyLineSegment.cs
- MonthChangedEventArgs.cs
- HebrewNumber.cs
- XpsStructure.cs
- NumericUpDown.cs
- DetailsViewUpdatedEventArgs.cs
- MessagePropertyFilter.cs
- DBDataPermissionAttribute.cs
- BmpBitmapDecoder.cs
- Fonts.cs
- ProgressBarAutomationPeer.cs
- MultiPageTextView.cs
- OleDbDataAdapter.cs
- SoapSchemaExporter.cs
- SqlDataSourceView.cs
- StructureChangedEventArgs.cs
- ScriptMethodAttribute.cs
- CacheMemory.cs
- ITreeGenerator.cs
- WriterOutput.cs
- ContainerAction.cs
- _SslState.cs
- arabicshape.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- Psha1DerivedKeyGenerator.cs
- SchemaMapping.cs
- _Semaphore.cs
- LineServices.cs
- CodeTypeMemberCollection.cs
- BrushMappingModeValidation.cs
- ProjectedWrapper.cs
- ToolStripGrip.cs
- BitmapDecoder.cs
- RightsManagementEncryptionTransform.cs
- DataMemberConverter.cs
- SoapMessage.cs
- DataControlFieldHeaderCell.cs
- DataGridItemEventArgs.cs
- ResourceAttributes.cs
- TextHidden.cs
- WindowsListViewSubItem.cs
- SessionIDManager.cs
- ClientScriptItemCollection.cs
- CultureInfo.cs
- InputBinder.cs
- CompositionCommandSet.cs
- ManualResetEvent.cs
- printdlgexmarshaler.cs
- CodeAccessSecurityEngine.cs
- SqlHelper.cs
- ListViewUpdatedEventArgs.cs
- MatrixAnimationUsingPath.cs
- FileSystemInfo.cs
- BoundPropertyEntry.cs
- DecryptedHeader.cs
- RuleRef.cs
- Memoizer.cs
- RecognizerBase.cs
- counter.cs
- SecurityChannelFaultConverter.cs
- DataGridViewCellStyleChangedEventArgs.cs
- BindableAttribute.cs
- EntitySetBase.cs
- Exceptions.cs
- ScrollItemPattern.cs
- TemplatedMailWebEventProvider.cs
- ByteStorage.cs
- PerfCounterSection.cs