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
- ContentTypeSettingClientMessageFormatter.cs
- CatalogPartChrome.cs
- SafeThreadHandle.cs
- AppendHelper.cs
- XPathDocumentBuilder.cs
- Utils.cs
- DeviceOverridableAttribute.cs
- BufferedWebEventProvider.cs
- AssemblyAttributesGoHere.cs
- ArithmeticException.cs
- DateTimeConstantAttribute.cs
- MessagingDescriptionAttribute.cs
- EnumDataContract.cs
- XmlNamespaceMappingCollection.cs
- EmptyStringExpandableObjectConverter.cs
- HeaderLabel.cs
- MaskDescriptor.cs
- ReferentialConstraint.cs
- OrderingQueryOperator.cs
- DbDataAdapter.cs
- ScriptingJsonSerializationSection.cs
- KeyValuePairs.cs
- ApplicationBuildProvider.cs
- _NetworkingPerfCounters.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- ToolStripSeparator.cs
- GroupPartitionExpr.cs
- Int64AnimationBase.cs
- CellParagraph.cs
- SetStateEventArgs.cs
- DropShadowBitmapEffect.cs
- ReadWriteObjectLock.cs
- CmsUtils.cs
- XmlSchemaImporter.cs
- ScriptManager.cs
- SqlDataReaderSmi.cs
- ColorAnimation.cs
- _IPv4Address.cs
- XsdBuilder.cs
- XsltSettings.cs
- XmlBoundElement.cs
- ElementProxy.cs
- ViewLoader.cs
- BitmapEffectrendercontext.cs
- TypeNameConverter.cs
- AdPostCacheSubstitution.cs
- ProfileSettings.cs
- XmlSchemaAttributeGroup.cs
- ConfigXmlCDataSection.cs
- ComponentRenameEvent.cs
- AppDomainUnloadedException.cs
- ParameterModifier.cs
- TripleDESCryptoServiceProvider.cs
- LabelInfo.cs
- Pair.cs
- Compilation.cs
- IntellisenseTextBox.cs
- BlurEffect.cs
- LambdaCompiler.Address.cs
- TextElement.cs
- EditingCoordinator.cs
- PageAsyncTask.cs
- ReachSerializableProperties.cs
- AbstractSvcMapFileLoader.cs
- MessageSecurityProtocolFactory.cs
- XmlSerializationWriter.cs
- ConnectionPointCookie.cs
- UpDownEvent.cs
- ParserStreamGeometryContext.cs
- WebPartCollection.cs
- SortedList.cs
- ThicknessAnimationBase.cs
- RectAnimationBase.cs
- StrokeNodeData.cs
- RuntimeConfigLKG.cs
- AuthorizationSection.cs
- EventDescriptor.cs
- ConfigurationManager.cs
- FileStream.cs
- RijndaelManaged.cs
- RoleGroupCollection.cs
- OdbcConnectionHandle.cs
- ByteAnimation.cs
- ObjectDataSourceChooseTypePanel.cs
- smtpconnection.cs
- AsyncResult.cs
- WindowsListViewScroll.cs
- DrawingContext.cs
- filewebrequest.cs
- TailPinnedEventArgs.cs
- ImageSource.cs
- IisTraceWebEventProvider.cs
- MetadataItemEmitter.cs
- ActivityExecutor.cs
- LinkTarget.cs
- DataControlFieldHeaderCell.cs
- DataProtectionSecurityStateEncoder.cs
- FormsAuthenticationEventArgs.cs
- OneOfTypeConst.cs
- StylusEventArgs.cs