Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- UnauthorizedWebPart.cs
- EntityWithKeyStrategy.cs
- D3DImage.cs
- BookmarkOptionsHelper.cs
- ColorPalette.cs
- ValidationPropertyAttribute.cs
- DataSet.cs
- CodeNamespace.cs
- CollectionViewGroupRoot.cs
- CreateUserWizard.cs
- ServicesSection.cs
- CssStyleCollection.cs
- FileDialog_Vista_Interop.cs
- XPathNodeIterator.cs
- ExpandedWrapper.cs
- RuntimeConfigLKG.cs
- FormsAuthenticationUser.cs
- ScriptModule.cs
- SvcMapFileSerializer.cs
- CallTemplateAction.cs
- CalendarDayButton.cs
- XPathScanner.cs
- __Filters.cs
- DocumentEventArgs.cs
- IxmlLineInfo.cs
- TransactionContext.cs
- FontConverter.cs
- RIPEMD160.cs
- ToolStripScrollButton.cs
- StylusOverProperty.cs
- InfoCardListRequest.cs
- EllipseGeometry.cs
- StreamInfo.cs
- Control.cs
- ToolConsole.cs
- TypeSystem.cs
- ViewStateException.cs
- BinaryCommonClasses.cs
- _AutoWebProxyScriptWrapper.cs
- PngBitmapDecoder.cs
- CompilerInfo.cs
- WebPartConnectionsConfigureVerb.cs
- PixelShader.cs
- BitmapScalingModeValidation.cs
- PeerResolverSettings.cs
- XmlSchemaImporter.cs
- InputManager.cs
- ChannelServices.cs
- CommandLineParser.cs
- PrivilegedConfigurationManager.cs
- SudsWriter.cs
- Attributes.cs
- WebException.cs
- SynchronousChannel.cs
- RuleInfoComparer.cs
- PackagingUtilities.cs
- InstanceNotReadyException.cs
- StreamUpdate.cs
- PenThreadPool.cs
- TextRunProperties.cs
- SoundPlayer.cs
- ItemList.cs
- PartialCachingControl.cs
- MergeFilterQuery.cs
- TagPrefixCollection.cs
- RepeatButtonAutomationPeer.cs
- ReadOnlyAttribute.cs
- DbFunctionCommandTree.cs
- ProfileBuildProvider.cs
- FrameworkElement.cs
- DataRecordObjectView.cs
- remotingproxy.cs
- KeyPressEvent.cs
- EmissiveMaterial.cs
- NotFiniteNumberException.cs
- BooleanAnimationUsingKeyFrames.cs
- CollectionEditor.cs
- Byte.cs
- TextContainerChangedEventArgs.cs
- MsmqProcessProtocolHandler.cs
- InternalMappingException.cs
- DataServiceRequestException.cs
- FocusWithinProperty.cs
- BooleanStorage.cs
- RegexCharClass.cs
- UrlParameterReader.cs
- RotateTransform3D.cs
- TreeNodeStyle.cs
- EntityDataSourceState.cs
- HitTestWithGeometryDrawingContextWalker.cs
- DesignerDeviceConfig.cs
- SocketException.cs
- SQLDecimal.cs
- BooleanSwitch.cs
- StructuredTypeInfo.cs
- Underline.cs
- TransactedBatchingBehavior.cs
- QuaternionAnimation.cs
- JoinElimination.cs
- BaseUriHelper.cs