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
- KeyConverter.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- DependencyPropertyKey.cs
- SeverityFilter.cs
- SecondaryViewProvider.cs
- XmlElementAttribute.cs
- Int16KeyFrameCollection.cs
- FramingChannels.cs
- MemberNameValidator.cs
- DocComment.cs
- HttpContext.cs
- EditorZoneBase.cs
- XPathParser.cs
- EnumBuilder.cs
- RoleService.cs
- Point4DValueSerializer.cs
- DataStorage.cs
- MemberListBinding.cs
- ISessionStateStore.cs
- TextTreeText.cs
- BindingContext.cs
- DesignerSerializerAttribute.cs
- RegexCompiler.cs
- DataGridViewUtilities.cs
- WebEvents.cs
- ParsedAttributeCollection.cs
- Group.cs
- SafeEventLogWriteHandle.cs
- mediaeventargs.cs
- TempFiles.cs
- TreeViewDesigner.cs
- FieldToken.cs
- LineGeometry.cs
- RelationshipDetailsRow.cs
- DragAssistanceManager.cs
- FastPropertyAccessor.cs
- ConstraintConverter.cs
- DataGridDetailsPresenterAutomationPeer.cs
- StateBag.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- AlgoModule.cs
- SqlConnectionPoolProviderInfo.cs
- PageTheme.cs
- FontStyles.cs
- UserInitiatedRoutedEventPermission.cs
- EdmValidator.cs
- BookmarkScopeInfo.cs
- BrowserDefinition.cs
- EncodingTable.cs
- XmlDataSourceView.cs
- dbdatarecord.cs
- LocalValueEnumerator.cs
- ListViewDeleteEventArgs.cs
- DeclarationUpdate.cs
- ResourceProviderFactory.cs
- Size.cs
- QualifiedCellIdBoolean.cs
- FrameworkElement.cs
- SymmetricAlgorithm.cs
- ThreadStaticAttribute.cs
- Parameter.cs
- DeploymentSection.cs
- BitmapPalette.cs
- SimpleRecyclingCache.cs
- CryptoStream.cs
- ServerProtocol.cs
- MarkupObject.cs
- NavigationEventArgs.cs
- Stopwatch.cs
- ScriptingRoleServiceSection.cs
- SHA1Managed.cs
- SQLCharsStorage.cs
- XmlException.cs
- Grant.cs
- CustomAttribute.cs
- BuildProviderUtils.cs
- QueuePropertyVariants.cs
- IndexedString.cs
- Choices.cs
- Compiler.cs
- SrgsDocumentParser.cs
- VisualState.cs
- HttpServerVarsCollection.cs
- PartitionerQueryOperator.cs
- CurrencyWrapper.cs
- WebServiceEnumData.cs
- XmlDictionary.cs
- LinqDataView.cs
- XmlElementAttributes.cs
- MethodAccessException.cs
- TraceShell.cs
- AppendHelper.cs
- DataGridViewHeaderCell.cs
- OAVariantLib.cs
- PropertyGridEditorPart.cs
- PauseStoryboard.cs
- CharEnumerator.cs
- ValidationRule.cs
- OracleCommand.cs
- xmlformatgeneratorstatics.cs