Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / GlobalProxySelection.cs / 1305376 / 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
- SafeNativeMethods.cs
- AsymmetricAlgorithm.cs
- XmlEnumAttribute.cs
- InternalConfigRoot.cs
- Triangle.cs
- RequestSecurityToken.cs
- Win32SafeHandles.cs
- PageThemeCodeDomTreeGenerator.cs
- IisTraceWebEventProvider.cs
- Font.cs
- UserControlCodeDomTreeGenerator.cs
- PtsHost.cs
- TraceProvider.cs
- SynchronizedPool.cs
- SqlClientWrapperSmiStream.cs
- PathFigureCollection.cs
- GraphicsState.cs
- TracePayload.cs
- SqlDataSourceCache.cs
- BooleanFunctions.cs
- Substitution.cs
- NotImplementedException.cs
- Positioning.cs
- DataObjectMethodAttribute.cs
- XPathDescendantIterator.cs
- TrackBarRenderer.cs
- ConnectionPoint.cs
- GB18030Encoding.cs
- SqlCommandBuilder.cs
- SafeNativeMethods.cs
- XPathDocumentNavigator.cs
- WorkflowCompensationBehavior.cs
- StylusPointDescription.cs
- TogglePattern.cs
- mediaeventshelper.cs
- UrlMappingsModule.cs
- PrePrepareMethodAttribute.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- Viewport2DVisual3D.cs
- DefaultPropertyAttribute.cs
- SessionStateContainer.cs
- HtmlShimManager.cs
- complextypematerializer.cs
- Preprocessor.cs
- HyperLink.cs
- MethodBody.cs
- OutputWindow.cs
- arabicshape.cs
- AdPostCacheSubstitution.cs
- TickBar.cs
- CryptographicAttribute.cs
- SafeRightsManagementEnvironmentHandle.cs
- EventWaitHandleSecurity.cs
- ComplexTypeEmitter.cs
- GraphicsState.cs
- SqlTypeConverter.cs
- DPAPIProtectedConfigurationProvider.cs
- ServerTooBusyException.cs
- MetadataArtifactLoader.cs
- FontResourceCache.cs
- HyperLink.cs
- ImageButton.cs
- PeerDefaultCustomResolverClient.cs
- SubMenuStyleCollection.cs
- OleDbParameter.cs
- OleDbConnectionFactory.cs
- Tablet.cs
- WebPartConnectionsDisconnectVerb.cs
- EnumDataContract.cs
- ListControlDataBindingHandler.cs
- IISMapPath.cs
- DrawingDrawingContext.cs
- TriggerActionCollection.cs
- LinkTarget.cs
- UrlMappingsSection.cs
- WebPartsSection.cs
- GatewayIPAddressInformationCollection.cs
- InitializingNewItemEventArgs.cs
- Int64Storage.cs
- XmlDictionaryReader.cs
- ApplicationCommands.cs
- RadioButtonRenderer.cs
- StringExpressionSet.cs
- Point4D.cs
- XmlQueryRuntime.cs
- mactripleDES.cs
- TdsValueSetter.cs
- ScriptManagerProxy.cs
- Membership.cs
- TransformedBitmap.cs
- ColumnResizeAdorner.cs
- ObjectPersistData.cs
- MiniAssembly.cs
- SapiRecoContext.cs
- StorageModelBuildProvider.cs
- StylusDownEventArgs.cs
- DataServiceQueryProvider.cs
- StylusPointPropertyInfoDefaults.cs
- LinqDataSourceSelectEventArgs.cs
- FileSystemInfo.cs