Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Net / System / Net / Configuration / SocketElement.cs / 1 / SocketElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Reflection; using System.Security.Permissions; public sealed class SocketElement : ConfigurationElement { public SocketElement() { this.properties.Add(this.alwaysUseCompletionPortsForAccept); this.properties.Add(this.alwaysUseCompletionPortsForConnect); } protected override void PostDeserialize() { // Perf optimization. If the configuration is coming from machine.config // It is safe and we don't need to check for permissions. if (EvaluationContext.IsMachineLevel) return; try { ExceptionHelper.UnrestrictedSocketPermission.Demand(); } catch (Exception exception) { throw new ConfigurationErrorsException( SR.GetString(SR.net_config_element_permission, ConfigurationStrings.Socket), exception); } } [ConfigurationProperty(ConfigurationStrings.AlwaysUseCompletionPortsForAccept, DefaultValue = false)] public bool AlwaysUseCompletionPortsForAccept { get { return (bool)this[this.alwaysUseCompletionPortsForAccept]; } set { this[this.alwaysUseCompletionPortsForAccept] = value; } } [ConfigurationProperty(ConfigurationStrings.AlwaysUseCompletionPortsForConnect, DefaultValue = false)] public bool AlwaysUseCompletionPortsForConnect { get { return (bool)this[this.alwaysUseCompletionPortsForConnect]; } set { this[this.alwaysUseCompletionPortsForConnect] = value; } } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty alwaysUseCompletionPortsForConnect = new ConfigurationProperty(ConfigurationStrings.AlwaysUseCompletionPortsForConnect, typeof(bool), false, ConfigurationPropertyOptions.None); readonly ConfigurationProperty alwaysUseCompletionPortsForAccept = new ConfigurationProperty(ConfigurationStrings.AlwaysUseCompletionPortsForAccept, typeof(bool), false, ConfigurationPropertyOptions.None); } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Reflection; using System.Security.Permissions; public sealed class SocketElement : ConfigurationElement { public SocketElement() { this.properties.Add(this.alwaysUseCompletionPortsForAccept); this.properties.Add(this.alwaysUseCompletionPortsForConnect); } protected override void PostDeserialize() { // Perf optimization. If the configuration is coming from machine.config // It is safe and we don't need to check for permissions. if (EvaluationContext.IsMachineLevel) return; try { ExceptionHelper.UnrestrictedSocketPermission.Demand(); } catch (Exception exception) { throw new ConfigurationErrorsException( SR.GetString(SR.net_config_element_permission, ConfigurationStrings.Socket), exception); } } [ConfigurationProperty(ConfigurationStrings.AlwaysUseCompletionPortsForAccept, DefaultValue = false)] public bool AlwaysUseCompletionPortsForAccept { get { return (bool)this[this.alwaysUseCompletionPortsForAccept]; } set { this[this.alwaysUseCompletionPortsForAccept] = value; } } [ConfigurationProperty(ConfigurationStrings.AlwaysUseCompletionPortsForConnect, DefaultValue = false)] public bool AlwaysUseCompletionPortsForConnect { get { return (bool)this[this.alwaysUseCompletionPortsForConnect]; } set { this[this.alwaysUseCompletionPortsForConnect] = value; } } protected override ConfigurationPropertyCollection Properties { get { return this.properties; } } ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); readonly ConfigurationProperty alwaysUseCompletionPortsForConnect = new ConfigurationProperty(ConfigurationStrings.AlwaysUseCompletionPortsForConnect, typeof(bool), false, ConfigurationPropertyOptions.None); readonly ConfigurationProperty alwaysUseCompletionPortsForAccept = new ConfigurationProperty(ConfigurationStrings.AlwaysUseCompletionPortsForAccept, typeof(bool), false, ConfigurationPropertyOptions.None); } } // 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
- StringKeyFrameCollection.cs
- Path.cs
- X509Extension.cs
- SetIndexBinder.cs
- TypeElement.cs
- XmlSchemaAll.cs
- UxThemeWrapper.cs
- RangeValuePattern.cs
- SSmlParser.cs
- LambdaCompiler.Unary.cs
- TriggerBase.cs
- ReliableOutputConnection.cs
- KeyNotFoundException.cs
- ControlOperationBehavior.cs
- CalendarDay.cs
- PerformanceCountersElement.cs
- BCLDebug.cs
- DragCompletedEventArgs.cs
- CodeLinePragma.cs
- RootNamespaceAttribute.cs
- LockedActivityGlyph.cs
- FilteredAttributeCollection.cs
- UnicastIPAddressInformationCollection.cs
- _Rfc2616CacheValidators.cs
- AddingNewEventArgs.cs
- SchemaHelper.cs
- ClientEventManager.cs
- TextFindEngine.cs
- UTF8Encoding.cs
- XdrBuilder.cs
- NameTable.cs
- NativeCppClassAttribute.cs
- GeometryModel3D.cs
- Compensation.cs
- SendKeys.cs
- DatePickerAutomationPeer.cs
- ParentControlDesigner.cs
- ContractHandle.cs
- RemotingServices.cs
- Listbox.cs
- DataGridViewCellConverter.cs
- __Filters.cs
- FlatButtonAppearance.cs
- XmlUnspecifiedAttribute.cs
- SimpleTypesSurrogate.cs
- MediaPlayer.cs
- documentsequencetextpointer.cs
- DbSourceParameterCollection.cs
- IncrementalReadDecoders.cs
- RC2.cs
- CodeTypeConstructor.cs
- CopyCodeAction.cs
- PageCatalogPartDesigner.cs
- MimePart.cs
- JoinTreeSlot.cs
- DrawingGroup.cs
- SqlSupersetValidator.cs
- BitStack.cs
- GetRecipientListRequest.cs
- CodeCommentStatement.cs
- SqlConnectionString.cs
- ButtonField.cs
- RemoteWebConfigurationHostServer.cs
- MultilineStringConverter.cs
- DataServiceBehavior.cs
- LineGeometry.cs
- Geometry.cs
- _IPv6Address.cs
- ResourceProviderFactory.cs
- DayRenderEvent.cs
- StyleModeStack.cs
- ApplicationSettingsBase.cs
- SimpleRecyclingCache.cs
- SafeSecurityHandles.cs
- Soap11ServerProtocol.cs
- RenderData.cs
- CryptoKeySecurity.cs
- NativeRightsManagementAPIsStructures.cs
- RotateTransform.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- SizeAnimation.cs
- DataGridViewCellStyleBuilderDialog.cs
- AccessedThroughPropertyAttribute.cs
- ImageAttributes.cs
- DesignTimeSiteMapProvider.cs
- ItemsControlAutomationPeer.cs
- SplitterPanel.cs
- RootBrowserWindowAutomationPeer.cs
- DocumentViewerConstants.cs
- StrongNameMembershipCondition.cs
- QueryContinueDragEvent.cs
- ColorTransformHelper.cs
- SHA1CryptoServiceProvider.cs
- SqlConnectionStringBuilder.cs
- BeginStoryboard.cs
- XmlTextWriter.cs
- OdbcParameterCollection.cs
- DoubleKeyFrameCollection.cs
- DirectoryObjectSecurity.cs
- DbConvert.cs