Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Configuration / ServiceHostingEnvironmentSection.cs / 2 / ServiceHostingEnvironmentSection.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Configuration { using System.Configuration; using System.ServiceModel; using System.Globalization; using System.Security; using System.Security.Permissions; public sealed partial class ServiceHostingEnvironmentSection : ConfigurationSection { public ServiceHostingEnvironmentSection() { } 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; } if (PropertyValueOrigin.SetHere == ElementInformation.Properties[ConfigurationStrings.MinFreeMemoryPercentageToActivateService].ValueOrigin) { try { new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand(); } catch (SecurityException) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException( SR.GetString(SR.Hosting_MemoryGatesCheckFailedUnderPartialTrust))); } } } [ConfigurationProperty(ConfigurationStrings.DefaultCollectionName, Options = ConfigurationPropertyOptions.IsDefaultCollection)] public TransportConfigurationTypeElementCollection TransportConfigurationTypes { get {return (TransportConfigurationTypeElementCollection) base[ConfigurationStrings.DefaultCollectionName]; } } [ConfigurationProperty(ConfigurationStrings.BaseAddressPrefixFilters, Options = ConfigurationPropertyOptions.None)] public BaseAddressPrefixFilterElementCollection BaseAddressPrefixFilters { get { return (BaseAddressPrefixFilterElementCollection)base[ConfigurationStrings.BaseAddressPrefixFilters]; } } [ConfigurationProperty(ConfigurationStrings.AspNetCompatibilityEnabled, DefaultValue = false)] public bool AspNetCompatibilityEnabled { get { return (bool)base[ConfigurationStrings.AspNetCompatibilityEnabled]; } set { base[ConfigurationStrings.AspNetCompatibilityEnabled] = value; } } [ConfigurationProperty(ConfigurationStrings.MinFreeMemoryPercentageToActivateService, DefaultValue = 5)] [IntegerValidator(MinValue = 0, MaxValue = 99)] public int MinFreeMemoryPercentageToActivateService { get { return (int)base[ConfigurationStrings.MinFreeMemoryPercentageToActivateService]; } set { base[ConfigurationStrings.MinFreeMemoryPercentageToActivateService] = value; } } internal static ServiceHostingEnvironmentSection GetSection() { return (ServiceHostingEnvironmentSection)ConfigurationHelpers.GetSection(ConfigurationStrings.ServiceHostingEnvironmentSectionPath); } ////// Critical - calls Critical method UnsafeGetSection which elevates in order to fetch config /// caller must guard access to resultant config section /// [SecurityCritical] internal static ServiceHostingEnvironmentSection UnsafeGetSection() { return (ServiceHostingEnvironmentSection)ConfigurationHelpers.UnsafeGetSection(ConfigurationStrings.ServiceHostingEnvironmentSectionPath); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridCaption.cs
- Events.cs
- InternalConfigRoot.cs
- CompilationLock.cs
- Comparer.cs
- TimerElapsedEvenArgs.cs
- TimeStampChecker.cs
- HwndHost.cs
- DataGridViewSelectedColumnCollection.cs
- HttpDictionary.cs
- UIElement3D.cs
- MemberPath.cs
- RelatedPropertyManager.cs
- OracleConnectionFactory.cs
- serverconfig.cs
- CssClassPropertyAttribute.cs
- ActiveXSite.cs
- DependencySource.cs
- CircleHotSpot.cs
- Int32EqualityComparer.cs
- ResXResourceSet.cs
- HyperLinkDesigner.cs
- HttpModulesSection.cs
- TemplatedWizardStep.cs
- SerializableAuthorizationContext.cs
- PeerNearMe.cs
- Polygon.cs
- FileFormatException.cs
- ComContractElement.cs
- ArrayElementGridEntry.cs
- ScriptReferenceBase.cs
- FixedSOMLineRanges.cs
- XmlSerializerOperationBehavior.cs
- WebRequest.cs
- AssertFilter.cs
- DesignTimeSiteMapProvider.cs
- SpeechEvent.cs
- CqlGenerator.cs
- SecurityTokenAuthenticator.cs
- OracleSqlParser.cs
- HttpHandlersSection.cs
- ResourceReader.cs
- EventLogPermission.cs
- HtmlElementErrorEventArgs.cs
- Point3DAnimation.cs
- ArraySet.cs
- DSASignatureDeformatter.cs
- UIElement.cs
- DiscoveryMessageProperty.cs
- RegexNode.cs
- DockingAttribute.cs
- CallContext.cs
- ReadOnlyCollection.cs
- CoTaskMemHandle.cs
- FormViewModeEventArgs.cs
- SmiRequestExecutor.cs
- ColorContextHelper.cs
- DataGridTableStyleMappingNameEditor.cs
- BitmapEffectGroup.cs
- AuthenticationModuleElement.cs
- Relationship.cs
- EditingCoordinator.cs
- SolidColorBrush.cs
- DataGridViewColumnHeaderCell.cs
- DropDownButton.cs
- SqlInternalConnectionSmi.cs
- BaseResourcesBuildProvider.cs
- TableStyle.cs
- UnmanagedBitmapWrapper.cs
- SoapAttributeAttribute.cs
- SystemException.cs
- BookmarkUndoUnit.cs
- ToolBar.cs
- TableDetailsRow.cs
- RangeValuePatternIdentifiers.cs
- FormsAuthenticationTicket.cs
- GridViewCancelEditEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- MaskInputRejectedEventArgs.cs
- StackBuilderSink.cs
- BigInt.cs
- InitiatorSessionSymmetricTransportSecurityProtocol.cs
- SecureStringHasher.cs
- InteropEnvironment.cs
- IPGlobalProperties.cs
- SchemaTypeEmitter.cs
- EventHandlerList.cs
- InputReportEventArgs.cs
- PageEventArgs.cs
- PenContext.cs
- TypeUtils.cs
- PersistChildrenAttribute.cs
- PluralizationService.cs
- Schema.cs
- XmlCodeExporter.cs
- TextElementEnumerator.cs
- RectAnimationUsingKeyFrames.cs
- ColorConvertedBitmapExtension.cs
- WebPartConnection.cs
- Application.cs