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
- DbConnectionStringCommon.cs
- EnumType.cs
- VisualStyleRenderer.cs
- ThousandthOfEmRealDoubles.cs
- RootAction.cs
- ServiceThrottle.cs
- ColumnTypeConverter.cs
- TabRenderer.cs
- ProfessionalColors.cs
- PrintControllerWithStatusDialog.cs
- CreateUserWizardAutoFormat.cs
- VisualStyleRenderer.cs
- TaiwanLunisolarCalendar.cs
- mda.cs
- ConfigurationManagerInternal.cs
- XmlNodeComparer.cs
- ResourceDescriptionAttribute.cs
- XmlTypeAttribute.cs
- GlobalizationSection.cs
- DataStreamFromComStream.cs
- TextElementCollectionHelper.cs
- DbConnectionFactory.cs
- ConfigurationStrings.cs
- OptionUsage.cs
- FullTextBreakpoint.cs
- PaperSize.cs
- GcSettings.cs
- AsymmetricAlgorithm.cs
- TextEditorContextMenu.cs
- Win32.cs
- XslCompiledTransform.cs
- DeferredElementTreeState.cs
- DiscoveryDefaults.cs
- BindingValueChangedEventArgs.cs
- CodeMethodMap.cs
- FrameworkElement.cs
- EventMap.cs
- SchemaNamespaceManager.cs
- DataFieldCollectionEditor.cs
- EventLogEntry.cs
- CompiledQueryCacheKey.cs
- PropertyMetadata.cs
- WinEventQueueItem.cs
- RuntimeHandles.cs
- BinaryCommonClasses.cs
- sapiproxy.cs
- XmlSchemaDocumentation.cs
- CallbackValidatorAttribute.cs
- DragEvent.cs
- BuildProviderUtils.cs
- datacache.cs
- IntellisenseTextBox.designer.cs
- ClientConfigPaths.cs
- DocumentScope.cs
- CharacterHit.cs
- XsdBuilder.cs
- HeaderedContentControl.cs
- CommandPlan.cs
- FlowLayoutSettings.cs
- LostFocusEventManager.cs
- CalendarAutoFormatDialog.cs
- StringArrayConverter.cs
- DataRowChangeEvent.cs
- Publisher.cs
- ReachPageContentCollectionSerializerAsync.cs
- ColorConverter.cs
- DaylightTime.cs
- CmsInterop.cs
- TargetPerspective.cs
- PropertyRef.cs
- FederatedMessageSecurityOverHttpElement.cs
- AnnotationResourceCollection.cs
- Point3DAnimation.cs
- ViewgenContext.cs
- ExceptionUtil.cs
- RegistryDataKey.cs
- AddInStore.cs
- HwndSubclass.cs
- ParagraphResult.cs
- Semaphore.cs
- ToolStripCodeDomSerializer.cs
- ToggleProviderWrapper.cs
- EventRecord.cs
- ReadOnlyMetadataCollection.cs
- FactoryGenerator.cs
- DBSchemaRow.cs
- WmpBitmapEncoder.cs
- TraceSection.cs
- CompiledAction.cs
- WebPartDisplayModeEventArgs.cs
- DeferredReference.cs
- KeyInfo.cs
- AdornedElementPlaceholder.cs
- Themes.cs
- DriveInfo.cs
- HttpListener.cs
- AssemblyCache.cs
- DataTablePropertyDescriptor.cs
- MemoryRecordBuffer.cs
- LinkLabelLinkClickedEvent.cs