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
- TextEmbeddedObject.cs
- TcpClientSocketManager.cs
- ExpressionLexer.cs
- KeyGestureConverter.cs
- BridgeDataReader.cs
- Container.cs
- Helper.cs
- ArraySegment.cs
- BaseComponentEditor.cs
- DrawingImage.cs
- DateTimeValueSerializer.cs
- TagPrefixInfo.cs
- EmptyReadOnlyDictionaryInternal.cs
- TCEAdapterGenerator.cs
- Visual3D.cs
- TabControlEvent.cs
- BitmapEffectGroup.cs
- SelectionProviderWrapper.cs
- TextParagraphCache.cs
- QueryOperationResponseOfT.cs
- Int64Storage.cs
- LinkConverter.cs
- ErrorFormatterPage.cs
- SessionState.cs
- GetImportedCardRequest.cs
- EdmEntityTypeAttribute.cs
- ResXDataNode.cs
- MasterPageParser.cs
- Table.cs
- SmtpCommands.cs
- PageBuildProvider.cs
- WebPartCatalogAddVerb.cs
- DBSchemaRow.cs
- Composition.cs
- Transform3DGroup.cs
- LocalTransaction.cs
- EventLogEntryCollection.cs
- ExpressionTable.cs
- MarkerProperties.cs
- UrlPropertyAttribute.cs
- PrintController.cs
- SqlBinder.cs
- recordstatefactory.cs
- AspNetCompatibilityRequirementsAttribute.cs
- EventsTab.cs
- TextEditorLists.cs
- DataSourceViewSchemaConverter.cs
- DependencyProperty.cs
- PointLightBase.cs
- DisposableCollectionWrapper.cs
- MaskedTextProvider.cs
- EntityKeyElement.cs
- TextViewSelectionProcessor.cs
- ManifestSignatureInformation.cs
- AppSecurityManager.cs
- ShaderEffect.cs
- PostBackTrigger.cs
- SmtpDateTime.cs
- SizeConverter.cs
- CharConverter.cs
- TextTrailingWordEllipsis.cs
- TextPointer.cs
- GorillaCodec.cs
- SafeNativeMethods.cs
- WSTrustDec2005.cs
- FontCacheLogic.cs
- BrowserCapabilitiesCodeGenerator.cs
- XmlWriterTraceListener.cs
- ApplicationHost.cs
- NameValueFileSectionHandler.cs
- WebBrowserProgressChangedEventHandler.cs
- AlphaSortedEnumConverter.cs
- NamespaceInfo.cs
- Annotation.cs
- FileUpload.cs
- RSAPKCS1SignatureFormatter.cs
- FrameworkElement.cs
- Root.cs
- WindowsRichEditRange.cs
- QueryInterceptorAttribute.cs
- ToolBarButtonClickEvent.cs
- sortedlist.cs
- TypedOperationInfo.cs
- ParallelTimeline.cs
- AsyncResult.cs
- ArgIterator.cs
- ComplexPropertyEntry.cs
- COAUTHIDENTITY.cs
- AppDomainFactory.cs
- PartialList.cs
- XmlWrappingReader.cs
- AutomationIdentifierGuids.cs
- UnsafeMethods.cs
- FtpWebResponse.cs
- EntityDataSourceUtil.cs
- MessageLogger.cs
- QuadraticBezierSegment.cs
- BreakRecordTable.cs
- Variable.cs
- GradientStop.cs