Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / GlobalProxySelection.cs / 1 / GlobalProxySelection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { [Obsolete("This class has been deprecated. Please use WebRequest.DefaultWebProxy instead to access and set the global default proxy. Use 'null' instead of GetEmptyWebProxy. http://go.microsoft.com/fwlink/?linkid=14202")] public class GlobalProxySelection { // This just wraps WebRequest.DefaultWebProxy and modifies it to be compatible with Everett. // It needs to return a WebProxy whenever possible, and an EmptyWebProxy instead of null. public static IWebProxy Select { get { IWebProxy proxy = WebRequest.DefaultWebProxy; if (proxy == null) { return GetEmptyWebProxy(); } WebRequest.WebProxyWrapper wrap = proxy as WebRequest.WebProxyWrapper; if (wrap != null) { return wrap.WebProxy; } return proxy; } set { WebRequest.DefaultWebProxy = value; } } public static IWebProxy GetEmptyWebProxy() { return new EmptyWebProxy(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { [Obsolete("This class has been deprecated. Please use WebRequest.DefaultWebProxy instead to access and set the global default proxy. Use 'null' instead of GetEmptyWebProxy. http://go.microsoft.com/fwlink/?linkid=14202")] public class GlobalProxySelection { // This just wraps WebRequest.DefaultWebProxy and modifies it to be compatible with Everett. // It needs to return a WebProxy whenever possible, and an EmptyWebProxy instead of null. public static IWebProxy Select { get { IWebProxy proxy = WebRequest.DefaultWebProxy; if (proxy == null) { return GetEmptyWebProxy(); } WebRequest.WebProxyWrapper wrap = proxy as WebRequest.WebProxyWrapper; if (wrap != null) { return wrap.WebProxy; } return proxy; } set { WebRequest.DefaultWebProxy = value; } } public static IWebProxy GetEmptyWebProxy() { return new EmptyWebProxy(); } } } // 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
- TypeDescriptionProvider.cs
- DataObjectPastingEventArgs.cs
- XmlSchemaComplexType.cs
- ReadOnlyCollectionBase.cs
- FormView.cs
- MultiDataTrigger.cs
- _UriSyntax.cs
- DataControlFieldHeaderCell.cs
- ResourcesChangeInfo.cs
- DataGridViewCellEventArgs.cs
- HttpClientCertificate.cs
- FlowPosition.cs
- X509CertificateStore.cs
- RequestFactory.cs
- XmlSchemaSimpleTypeUnion.cs
- ParameterCollection.cs
- DataListCommandEventArgs.cs
- ResourceExpressionBuilder.cs
- LoadGrammarCompletedEventArgs.cs
- Membership.cs
- BookmarkInfo.cs
- EmptyControlCollection.cs
- UnmanagedMarshal.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- SystemWebSectionGroup.cs
- XslCompiledTransform.cs
- EdgeProfileValidation.cs
- EventDescriptor.cs
- LabelLiteral.cs
- SvcMapFileSerializer.cs
- CatalogZone.cs
- SingleConverter.cs
- ConfigurationConverterBase.cs
- BuildProvider.cs
- ObjectKeyFrameCollection.cs
- RepeaterCommandEventArgs.cs
- ObjectItemAttributeAssemblyLoader.cs
- ProxyGenerator.cs
- httpstaticobjectscollection.cs
- FileFormatException.cs
- SqlFormatter.cs
- OleDbRowUpdatedEvent.cs
- XmlAnyAttributeAttribute.cs
- LazyInitializer.cs
- OutputCacheSettings.cs
- smtpconnection.cs
- RewritingPass.cs
- RadioButton.cs
- RSAOAEPKeyExchangeDeformatter.cs
- TextEditorSpelling.cs
- SByte.cs
- DeclaredTypeElement.cs
- UserPreferenceChangingEventArgs.cs
- InstanceDescriptor.cs
- RenderContext.cs
- InvalidContentTypeException.cs
- ObservableCollection.cs
- SponsorHelper.cs
- WebPartCatalogCloseVerb.cs
- ListViewInsertedEventArgs.cs
- WebPartCatalogAddVerb.cs
- XmlTextEncoder.cs
- SiteMapNodeItem.cs
- InteropBitmapSource.cs
- SoapFaultCodes.cs
- CategoryGridEntry.cs
- GeneralTransform.cs
- GC.cs
- GestureRecognizer.cs
- RemotingException.cs
- ConfigXmlElement.cs
- DownloadProgressEventArgs.cs
- PenThreadPool.cs
- InstancePersistenceContext.cs
- ContentElementAutomationPeer.cs
- PrtTicket_Public.cs
- FaultCode.cs
- ComplexTypeEmitter.cs
- XmlLanguageConverter.cs
- PlatformNotSupportedException.cs
- BuildProvider.cs
- BuildManager.cs
- fixedPageContentExtractor.cs
- SqlTypeConverter.cs
- Subtree.cs
- HttpApplication.cs
- File.cs
- BlockUIContainer.cs
- SchemaConstraints.cs
- IList.cs
- LineInfo.cs
- CacheAxisQuery.cs
- DesignerTransactionCloseEvent.cs
- BuildManagerHost.cs
- NetworkInformationPermission.cs
- TableLayoutPanelBehavior.cs
- XamlSerializer.cs
- PartialCachingAttribute.cs
- ToolboxBitmapAttribute.cs
- Control.cs