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
- UpdateRecord.cs
- DataPointer.cs
- DownloadProgressEventArgs.cs
- QilValidationVisitor.cs
- CodeCompileUnit.cs
- ListMarkerSourceInfo.cs
- HtmlElement.cs
- CollectionCodeDomSerializer.cs
- OdbcConnectionString.cs
- MissingFieldException.cs
- StrokeCollectionConverter.cs
- IndexOutOfRangeException.cs
- TypeValidationEventArgs.cs
- FontResourceCache.cs
- NavigationExpr.cs
- Cell.cs
- ToolboxItemAttribute.cs
- NameTable.cs
- FrameDimension.cs
- AssemblyBuilder.cs
- DataMemberFieldEditor.cs
- MailSettingsSection.cs
- Group.cs
- CompoundFileIOPermission.cs
- ToolStrip.cs
- XXXOnTypeBuilderInstantiation.cs
- CustomErrorsSectionWrapper.cs
- AdjustableArrowCap.cs
- ReferenceEqualityComparer.cs
- ValueCollectionParameterReader.cs
- StylusPointPropertyUnit.cs
- CompiledIdentityConstraint.cs
- CLRBindingWorker.cs
- ChannelServices.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- StateManagedCollection.cs
- LockedActivityGlyph.cs
- namescope.cs
- HttpSessionStateBase.cs
- Point3DValueSerializer.cs
- Latin1Encoding.cs
- RealizationContext.cs
- ClientConfigPaths.cs
- WebEventTraceProvider.cs
- TogglePatternIdentifiers.cs
- PropertyPathWorker.cs
- ConsoleKeyInfo.cs
- ComponentDispatcher.cs
- BamlResourceSerializer.cs
- SqlServices.cs
- LineVisual.cs
- DrawingCollection.cs
- Expander.cs
- Encoder.cs
- DataGridTextBox.cs
- StandardOleMarshalObject.cs
- CharEntityEncoderFallback.cs
- ContractMapping.cs
- TransformFinalBlockRequest.cs
- XmlIlTypeHelper.cs
- EntityParameterCollection.cs
- ContentElementCollection.cs
- CodeTypeParameterCollection.cs
- GetWinFXPath.cs
- ErrorInfoXmlDocument.cs
- WebPartMinimizeVerb.cs
- MTConfigUtil.cs
- GeneralTransform3D.cs
- ImageAttributes.cs
- SqlWriter.cs
- CodeSnippetTypeMember.cs
- HttpCookie.cs
- TabletDevice.cs
- HeaderedItemsControl.cs
- TableLayoutColumnStyleCollection.cs
- ObjectStateEntryDbDataRecord.cs
- WebDisplayNameAttribute.cs
- CompModSwitches.cs
- PhysicalAddress.cs
- TableLayout.cs
- KerberosReceiverSecurityToken.cs
- SiteMapDataSourceView.cs
- DataServiceRequestException.cs
- CqlParserHelpers.cs
- ResourceLoader.cs
- PrimitiveSchema.cs
- ThreadAbortException.cs
- MediaContext.cs
- AvTraceFormat.cs
- ProgressBarBrushConverter.cs
- SHA512CryptoServiceProvider.cs
- TrailingSpaceComparer.cs
- DefinitionBase.cs
- GroupItem.cs
- DynamicActivityTypeDescriptor.cs
- LineVisual.cs
- FlowNode.cs
- Decorator.cs
- PipelineModuleStepContainer.cs
- UndoUnit.cs