Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Configuration / SocketElement.cs / 1305376 / SocketElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Configuration { using System; using System.Configuration; using System.Net.Sockets; using System.Reflection; using System.Security.Permissions; public sealed class SocketElement : ConfigurationElement { public SocketElement() { this.properties.Add(this.alwaysUseCompletionPortsForAccept); this.properties.Add(this.alwaysUseCompletionPortsForConnect); this.properties.Add(this.ipProtectionLevel); } 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; } } [ConfigurationProperty(ConfigurationStrings.IPProtectionLevel, DefaultValue = IPProtectionLevel.Unspecified)] public IPProtectionLevel IPProtectionLevel { get { return (IPProtectionLevel)this[this.ipProtectionLevel]; } set { this[this.ipProtectionLevel] = 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); readonly ConfigurationProperty ipProtectionLevel = new ConfigurationProperty(ConfigurationStrings.IPProtectionLevel, typeof(IPProtectionLevel), IPProtectionLevel.Unspecified, 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
- Selection.cs
- LinkLabelLinkClickedEvent.cs
- AllowedAudienceUriElementCollection.cs
- DataGridTable.cs
- AttributeProviderAttribute.cs
- DataContractSet.cs
- AttachedAnnotation.cs
- MailWebEventProvider.cs
- ConfigurationConverterBase.cs
- EventSinkHelperWriter.cs
- ServiceParser.cs
- ExpressionNormalizer.cs
- KoreanLunisolarCalendar.cs
- HeaderCollection.cs
- IndentedWriter.cs
- CodeCompileUnit.cs
- Adorner.cs
- RoleService.cs
- WebPartEventArgs.cs
- ServiceObjectContainer.cs
- JumpItem.cs
- DifferencingCollection.cs
- OleDbInfoMessageEvent.cs
- CapabilitiesAssignment.cs
- MonitoringDescriptionAttribute.cs
- XmlPreloadedResolver.cs
- FlowPanelDesigner.cs
- NavigatorInput.cs
- FragmentNavigationEventArgs.cs
- Crc32.cs
- OutputScopeManager.cs
- PeerToPeerException.cs
- XPathArrayIterator.cs
- CompilerTypeWithParams.cs
- DisplayMemberTemplateSelector.cs
- CultureInfoConverter.cs
- RenderData.cs
- LayoutManager.cs
- EntityDataSourceDesignerHelper.cs
- XmlDataProvider.cs
- ToolBarOverflowPanel.cs
- NonParentingControl.cs
- BitmapEffectGeneralTransform.cs
- ResourceDescriptionAttribute.cs
- BitmapEffectOutputConnector.cs
- LayoutInformation.cs
- PartialTrustVisibleAssembly.cs
- ExchangeUtilities.cs
- StatusBar.cs
- ReadOnlyDictionary.cs
- Command.cs
- DeploymentSection.cs
- DataSourceCache.cs
- SqlTypeConverter.cs
- StylusPointProperty.cs
- Parallel.cs
- ModelTreeManager.cs
- AssemblyNameEqualityComparer.cs
- WsdlHelpGeneratorElement.cs
- MD5CryptoServiceProvider.cs
- WebColorConverter.cs
- RootBuilder.cs
- NetworkInformationPermission.cs
- InvokeCompletedEventArgs.cs
- DictionarySectionHandler.cs
- ForeignKeyConstraint.cs
- SmtpSection.cs
- DateBoldEvent.cs
- QilGenerator.cs
- XmlWriter.cs
- _ScatterGatherBuffers.cs
- BaseTreeIterator.cs
- ByteFacetDescriptionElement.cs
- GreenMethods.cs
- VirtualPathData.cs
- ProjectionCamera.cs
- DelegatingTypeDescriptionProvider.cs
- HMACSHA384.cs
- SessionParameter.cs
- WebPartEditVerb.cs
- XamlSerializationHelper.cs
- RequiredFieldValidator.cs
- SudsCommon.cs
- UpDownBase.cs
- ServiceRoute.cs
- TransformDescriptor.cs
- UpDownEvent.cs
- RightsManagementEncryptedStream.cs
- SmtpException.cs
- datacache.cs
- ListBindableAttribute.cs
- XmlHierarchicalEnumerable.cs
- ActivityMarkupSerializationProvider.cs
- CodeDirectiveCollection.cs
- PermissionSetTriple.cs
- AppDomainGrammarProxy.cs
- RoleExceptions.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- VectorValueSerializer.cs
- Decoder.cs