Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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;
///
///
/// Resolves external XML resources named by a
/// Uniform Resource Identifier (URI).
///
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
///
///
///
/// Creates a new instance of the XmlUrlResolver class.
///
///
public XmlUrlResolver() {
}
//UE attension
///
///
/// [To be supplied.]
///
public override ICredentials Credentials {
set { _credentials = value; }
}
// Resource resolution
///
///
/// Maps a
/// URI to an Object containing the actual resource.
///
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);
}
}
///
///
/// [To be supplied.]
///
[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.
//------------------------------------------------------------------------------
//
// 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;
///
///
/// Resolves external XML resources named by a
/// Uniform Resource Identifier (URI).
///
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
///
///
///
/// Creates a new instance of the XmlUrlResolver class.
///
///
public XmlUrlResolver() {
}
//UE attension
///
///
/// [To be supplied.]
///
public override ICredentials Credentials {
set { _credentials = value; }
}
// Resource resolution
///
///
/// Maps a
/// URI to an Object containing the actual resource.
///
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);
}
}
///
///
/// [To be supplied.]
///
[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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ManagementOperationWatcher.cs
- RegistrationServices.cs
- SqlNode.cs
- DXD.cs
- SchemaNotation.cs
- ButtonChrome.cs
- OnOperation.cs
- Size3D.cs
- CacheChildrenQuery.cs
- HttpSessionStateBase.cs
- Location.cs
- WSTrustDec2005.cs
- SecurityVersion.cs
- RegexWorker.cs
- ReachFixedDocumentSerializer.cs
- EntityClientCacheEntry.cs
- Thread.cs
- AuthorizationRuleCollection.cs
- ActivityValidator.cs
- EventHandlersStore.cs
- ItemsPanelTemplate.cs
- AdapterUtil.cs
- SendKeys.cs
- cache.cs
- ContextMenuAutomationPeer.cs
- X509CertificateClaimSet.cs
- PageThemeCodeDomTreeGenerator.cs
- CompositeFontInfo.cs
- VirtualizingPanel.cs
- XmlTextReaderImplHelpers.cs
- Model3DGroup.cs
- DescriptionCreator.cs
- TimelineCollection.cs
- CapabilitiesPattern.cs
- SlotInfo.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- RowUpdatingEventArgs.cs
- HtmlInputHidden.cs
- X509ScopedServiceCertificateElement.cs
- ParameterReplacerVisitor.cs
- SettingsProperty.cs
- LinkConverter.cs
- SerialErrors.cs
- EncodingTable.cs
- MultiPropertyDescriptorGridEntry.cs
- CompositionTarget.cs
- XmlSchemaAppInfo.cs
- KeyConverter.cs
- FormatVersion.cs
- CompleteWizardStep.cs
- Int32RectConverter.cs
- Literal.cs
- IndentedTextWriter.cs
- SynthesizerStateChangedEventArgs.cs
- DataListItemCollection.cs
- InvokeMethodActivity.cs
- WebPartTransformer.cs
- ForeignKeyFactory.cs
- SqlDataSourceStatusEventArgs.cs
- ManagementEventWatcher.cs
- ToolboxComponentsCreatingEventArgs.cs
- TextTreeTextNode.cs
- PerformanceCounterCategory.cs
- Brush.cs
- designeractionbehavior.cs
- SecurityTokenException.cs
- ReachIDocumentPaginatorSerializerAsync.cs
- RowBinding.cs
- Queue.cs
- TextRangeEditTables.cs
- precedingsibling.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- _DomainName.cs
- RenamedEventArgs.cs
- WindowsAuthenticationEventArgs.cs
- ReflectPropertyDescriptor.cs
- CounterSampleCalculator.cs
- SystemResources.cs
- QueryUtil.cs
- DetectEofStream.cs
- UnmanagedMemoryStreamWrapper.cs
- MultiAsyncResult.cs
- Matrix.cs
- GridEntry.cs
- KeyValueConfigurationElement.cs
- TraceLog.cs
- MethodBody.cs
- ParallelTimeline.cs
- CompilerResults.cs
- MsmqIntegrationProcessProtocolHandler.cs
- TemplateXamlTreeBuilder.cs
- TextSelection.cs
- BitmapEffectDrawingContextWalker.cs
- OdbcConnectionPoolProviderInfo.cs
- SerializationInfo.cs
- CryptoProvider.cs
- InnerItemCollectionView.cs
- TableLayoutStyle.cs
- RootBuilder.cs
- DataGridViewCellCancelEventArgs.cs