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
- DataGridViewSelectedCellCollection.cs
- ZoomComboBox.cs
- XPathSelectionIterator.cs
- ObjectDataSourceWizardForm.cs
- figurelengthconverter.cs
- RIPEMD160Managed.cs
- DBSqlParserTableCollection.cs
- ConfigurationValidatorBase.cs
- RolePrincipal.cs
- WindowsFormsHostAutomationPeer.cs
- OleDbConnectionInternal.cs
- UnsafeNativeMethods.cs
- XmlnsPrefixAttribute.cs
- BindingWorker.cs
- DiscreteKeyFrames.cs
- IdentityHolder.cs
- KeyBinding.cs
- DesignerSerializerAttribute.cs
- WindowsPen.cs
- BoolExpressionVisitors.cs
- RoleManagerEventArgs.cs
- __TransparentProxy.cs
- ReadOnlyHierarchicalDataSourceView.cs
- GridViewSortEventArgs.cs
- InkCollectionBehavior.cs
- TextBoxAutomationPeer.cs
- LinqDataSourceUpdateEventArgs.cs
- EntityContainerEntitySet.cs
- ExtractorMetadata.cs
- CompoundFileDeflateTransform.cs
- AppDomainGrammarProxy.cs
- EmptyWithCancelationCheckWorkItem.cs
- AnalyzedTree.cs
- SemanticValue.cs
- GregorianCalendar.cs
- NativeMethods.cs
- InvariantComparer.cs
- WithParamAction.cs
- Expression.cs
- MessageDecoder.cs
- LazyTextWriterCreator.cs
- xamlnodes.cs
- InputElement.cs
- PersonalizationProvider.cs
- RijndaelManagedTransform.cs
- BasicDesignerLoader.cs
- TransformValueSerializer.cs
- SamlAuthorizationDecisionClaimResource.cs
- SecurityPermission.cs
- VerticalAlignConverter.cs
- WorkflowFileItem.cs
- BuildProvider.cs
- SourceLineInfo.cs
- TextServicesManager.cs
- QueryUtil.cs
- Aggregates.cs
- ActivityExecutionContext.cs
- CodePageEncoding.cs
- BasePropertyDescriptor.cs
- WCFBuildProvider.cs
- SendActivityEventArgs.cs
- DataListItemEventArgs.cs
- WebSysDisplayNameAttribute.cs
- SimpleHandlerBuildProvider.cs
- Section.cs
- HandleRef.cs
- SamlNameIdentifierClaimResource.cs
- SafeHandles.cs
- ToolStripSeparatorRenderEventArgs.cs
- SpecularMaterial.cs
- SmiContext.cs
- PathTooLongException.cs
- EdmFunction.cs
- Int32Collection.cs
- XPathNodeIterator.cs
- MenuItemBindingCollection.cs
- SystemThemeKey.cs
- MetadataHelper.cs
- ExtendedPropertyCollection.cs
- Int64Converter.cs
- HostingPreferredMapPath.cs
- SqlFlattener.cs
- InvalidOleVariantTypeException.cs
- safelink.cs
- PeerName.cs
- ItemsControl.cs
- StringHandle.cs
- BitmapDecoder.cs
- XmlSchemaCollection.cs
- PlainXmlDeserializer.cs
- EventLogTraceListener.cs
- _ListenerRequestStream.cs
- ImplicitInputBrush.cs
- GetIsBrowserClientRequest.cs
- MethodMessage.cs
- DataSourceBooleanViewSchemaConverter.cs
- DataControlPagerLinkButton.cs
- Brush.cs
- EntityClassGenerator.cs
- ConnectionManagementElement.cs