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 / 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
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- SymDocumentType.cs
- KeyEvent.cs
- StylusCaptureWithinProperty.cs
- CompModSwitches.cs
- GACMembershipCondition.cs
- _FtpDataStream.cs
- SiteMapProvider.cs
- AttributeQuery.cs
- Debug.cs
- Constraint.cs
- CompositeDuplexElement.cs
- RegexBoyerMoore.cs
- RemotingConfiguration.cs
- RelationshipEndCollection.cs
- CorePropertiesFilter.cs
- ImageClickEventArgs.cs
- OledbConnectionStringbuilder.cs
- QuadraticBezierSegment.cs
- ContourSegment.cs
- DrawingContextWalker.cs
- _Connection.cs
- SQLInt32.cs
- CacheOutputQuery.cs
- DataTemplateKey.cs
- ColorMap.cs
- ObjectTypeMapping.cs
- Stylus.cs
- XamlReaderConstants.cs
- TreeView.cs
- DesignTimeTemplateParser.cs
- FixedSchema.cs
- CacheMemory.cs
- DataGridViewCellStyle.cs
- TcpServerChannel.cs
- QilUnary.cs
- AsyncPostBackErrorEventArgs.cs
- RelationshipDetailsCollection.cs
- PopupRootAutomationPeer.cs
- ContentWrapperAttribute.cs
- AppliedDeviceFiltersEditor.cs
- CustomDictionarySources.cs
- HttpRawResponse.cs
- XamlReader.cs
- mactripleDES.cs
- IgnoreFlushAndCloseStream.cs
- ValidatingPropertiesEventArgs.cs
- ActivityBindForm.Designer.cs
- HttpEncoderUtility.cs
- KeyValueSerializer.cs
- PageTheme.cs
- QuaternionConverter.cs
- EnumMember.cs
- Label.cs
- XamlVector3DCollectionSerializer.cs
- UrlAuthorizationModule.cs
- LazyInitializer.cs
- ExpandSegmentCollection.cs
- SequentialWorkflowRootDesigner.cs
- Point3DAnimationBase.cs
- ByteConverter.cs
- UInt64.cs
- HighContrastHelper.cs
- DataGridViewTextBoxColumn.cs
- AssemblyAttributesGoHere.cs
- Logging.cs
- ArrayConverter.cs
- HtmlTextViewAdapter.cs
- DataBoundControl.cs
- XamlStyleSerializer.cs
- Properties.cs
- PerformanceCounterManager.cs
- AssociativeAggregationOperator.cs
- ProviderCollection.cs
- Pointer.cs
- ProfileSettings.cs
- TextEvent.cs
- EventWaitHandle.cs
- Menu.cs
- Double.cs
- DateTimeParse.cs
- XmlUTF8TextReader.cs
- XmlExceptionHelper.cs
- ProbeMatches11.cs
- IdnMapping.cs
- CommonXSendMessage.cs
- WindowsAltTab.cs
- DebugControllerThread.cs
- TrackingRecord.cs
- SlotInfo.cs
- SortedDictionary.cs
- UnionExpr.cs
- ExceptionHandlersDesigner.cs
- RequestChannel.cs
- OutputScopeManager.cs
- MarkupProperty.cs
- TableSectionStyle.cs
- DirectoryInfo.cs
- ContentFileHelper.cs
- JpegBitmapEncoder.cs