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
- DebugTraceHelper.cs
- CompilationRelaxations.cs
- StringReader.cs
- HttpProfileBase.cs
- WorkflowServiceAttributes.cs
- NativeMethods.cs
- RemoteWebConfigurationHost.cs
- LinqDataSourceUpdateEventArgs.cs
- CommunicationObjectFaultedException.cs
- EmptyStringExpandableObjectConverter.cs
- OracleRowUpdatingEventArgs.cs
- EntityDataSource.cs
- TypeDelegator.cs
- ServiceDefaults.cs
- XmlSchemaCompilationSettings.cs
- MethodCallConverter.cs
- DeflateStreamAsyncResult.cs
- XPathNodeIterator.cs
- LocalValueEnumerator.cs
- RepeaterItemEventArgs.cs
- DataTemplateKey.cs
- CodeLabeledStatement.cs
- ScopeElementCollection.cs
- PageEventArgs.cs
- RangeValidator.cs
- _PooledStream.cs
- ImageFormat.cs
- CodeBinaryOperatorExpression.cs
- DataControlLinkButton.cs
- MailBnfHelper.cs
- smtpconnection.cs
- WsdlWriter.cs
- LowerCaseStringConverter.cs
- TabletDevice.cs
- JoinTreeSlot.cs
- GridViewRowCollection.cs
- SeverityFilter.cs
- KeyInfo.cs
- DataComponentGenerator.cs
- XPathNodePointer.cs
- CornerRadiusConverter.cs
- Command.cs
- LayoutManager.cs
- RowTypeElement.cs
- Odbc32.cs
- AnimatedTypeHelpers.cs
- InvalidPrinterException.cs
- OdbcReferenceCollection.cs
- DescendantBaseQuery.cs
- MethodBuilder.cs
- AppDomainCompilerProxy.cs
- XPathArrayIterator.cs
- PipelineModuleStepContainer.cs
- MediaPlayer.cs
- TagPrefixCollection.cs
- sqlpipe.cs
- Menu.cs
- Task.cs
- PrivilegedConfigurationManager.cs
- InheritanceService.cs
- ReaderOutput.cs
- _HTTPDateParse.cs
- Deserializer.cs
- SettingsProviderCollection.cs
- RawAppCommandInputReport.cs
- TreeIterator.cs
- ConstantProjectedSlot.cs
- ViewgenContext.cs
- ContentWrapperAttribute.cs
- XsltLoader.cs
- CodeDelegateCreateExpression.cs
- TrackingLocationCollection.cs
- AuthenticationService.cs
- XPathNodeIterator.cs
- MenuTracker.cs
- XmlParserContext.cs
- LOSFormatter.cs
- TransactionInformation.cs
- AttributeUsageAttribute.cs
- LocationSectionRecord.cs
- Drawing.cs
- HostingEnvironmentException.cs
- ValidatorUtils.cs
- EntityViewGenerationAttribute.cs
- StoreContentChangedEventArgs.cs
- Zone.cs
- SqlVersion.cs
- Renderer.cs
- ResourceCategoryAttribute.cs
- ResourceAttributes.cs
- SiteMapNode.cs
- NonParentingControl.cs
- HtmlPageAdapter.cs
- ObjectComplexPropertyMapping.cs
- BatchWriter.cs
- SplitContainer.cs
- RepeaterItemCollection.cs
- Screen.cs
- ProcessHostFactoryHelper.cs
- ServerValidateEventArgs.cs