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
- MaskedTextBoxTextEditorDropDown.cs
- ResourceExpressionEditorSheet.cs
- XamlSerializerUtil.cs
- WebPartEditorApplyVerb.cs
- ClrPerspective.cs
- BufferAllocator.cs
- WebPartTransformer.cs
- AspCompat.cs
- CompositeFontFamily.cs
- ListView.cs
- HttpWrapper.cs
- HtmlEmptyTagControlBuilder.cs
- SqlException.cs
- HotCommands.cs
- CheckBoxPopupAdapter.cs
- TimeZoneNotFoundException.cs
- EntityContainerAssociationSet.cs
- DataControlButton.cs
- ResourceProperty.cs
- BooleanSwitch.cs
- SvcMapFileSerializer.cs
- SchemaDeclBase.cs
- Icon.cs
- AutomationProperties.cs
- InstalledFontCollection.cs
- WebBrowsableAttribute.cs
- XmlSerializableReader.cs
- TransformerConfigurationWizardBase.cs
- ViewKeyConstraint.cs
- BuilderElements.cs
- HostingEnvironmentSection.cs
- UpWmlPageAdapter.cs
- CssTextWriter.cs
- OutputCacheSettingsSection.cs
- ReflectionHelper.cs
- Int64.cs
- SuppressMessageAttribute.cs
- TextDecoration.cs
- DataObjectCopyingEventArgs.cs
- ImageAttributes.cs
- ConnectionInterfaceCollection.cs
- SessionEndingCancelEventArgs.cs
- Types.cs
- SafeNativeMethods.cs
- UnsignedPublishLicense.cs
- ToolboxItem.cs
- RuntimeEnvironment.cs
- CodePrimitiveExpression.cs
- NotifyIcon.cs
- ToolboxDataAttribute.cs
- ClientSettingsProvider.cs
- Error.cs
- Pkcs9Attribute.cs
- EventTrigger.cs
- CollectionViewSource.cs
- ListMarkerSourceInfo.cs
- WindowsSolidBrush.cs
- BasePattern.cs
- Matrix3DValueSerializer.cs
- _CommandStream.cs
- XmlNamespaceDeclarationsAttribute.cs
- RootBrowserWindow.cs
- Catch.cs
- DataGridTableCollection.cs
- Table.cs
- BinaryParser.cs
- ConstantSlot.cs
- NativeMethods.cs
- SequentialWorkflowRootDesigner.cs
- _HelperAsyncResults.cs
- XmlNamedNodeMap.cs
- DataRelationCollection.cs
- OperationCanceledException.cs
- FileLevelControlBuilderAttribute.cs
- ControlEvent.cs
- PingOptions.cs
- DynamicRenderer.cs
- KeyValuePairs.cs
- DataBoundControlHelper.cs
- WinCategoryAttribute.cs
- EventMetadata.cs
- TableLayoutCellPaintEventArgs.cs
- StrongNameIdentityPermission.cs
- DataGridAddNewRow.cs
- LiteralTextContainerControlBuilder.cs
- DiagnosticStrings.cs
- Psha1DerivedKeyGenerator.cs
- Int64Storage.cs
- MessageSmuggler.cs
- RelatedView.cs
- XmlObjectSerializerReadContextComplex.cs
- TextEffect.cs
- IisTraceWebEventProvider.cs
- HtmlValidationSummaryAdapter.cs
- arc.cs
- PropertyGridDesigner.cs
- SiteOfOriginContainer.cs
- DesignerEventService.cs
- IssuedTokenParametersEndpointAddressElement.cs
- DataSysAttribute.cs