Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Serialization / System / Runtime / Serialization / Configuration / DeclaredTypeElement.cs / 1305376 / DeclaredTypeElement.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Runtime.Serialization.Configuration { using System; using System.Configuration; using System.Security.Permissions; using System.Security; public sealed partial class DeclaredTypeElement : ConfigurationElement { public DeclaredTypeElement() { } public DeclaredTypeElement(string typeName) : this() { if (String.IsNullOrEmpty(typeName)) { throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("typeName"); } this.Type = typeName; } [ConfigurationProperty(ConfigurationStrings.DefaultCollectionName, DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)] public TypeElementCollection KnownTypes { get { return (TypeElementCollection)base[ConfigurationStrings.DefaultCollectionName]; } } [ConfigurationProperty(ConfigurationStrings.Type, DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)] [DeclaredTypeValidator()] public string Type { get { return (string)base[ConfigurationStrings.Type]; } set { base[ConfigurationStrings.Type] = value; } } [Fx.Tag.SecurityNote(Critical = "Calls the critical methods of PartialTrustHelpers", Safe = "PartialTrustHelpers.IsInFullTrust demands for FullTrust")] [SecuritySafeCritical] 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(!PartialTrustHelpers.IsInFullTrust()) { throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigDataContractSerializerSectionLoadError))); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Runtime.Serialization.Configuration { using System; using System.Configuration; using System.Security.Permissions; using System.Security; public sealed partial class DeclaredTypeElement : ConfigurationElement { public DeclaredTypeElement() { } public DeclaredTypeElement(string typeName) : this() { if (String.IsNullOrEmpty(typeName)) { throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("typeName"); } this.Type = typeName; } [ConfigurationProperty(ConfigurationStrings.DefaultCollectionName, DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)] public TypeElementCollection KnownTypes { get { return (TypeElementCollection)base[ConfigurationStrings.DefaultCollectionName]; } } [ConfigurationProperty(ConfigurationStrings.Type, DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)] [DeclaredTypeValidator()] public string Type { get { return (string)base[ConfigurationStrings.Type]; } set { base[ConfigurationStrings.Type] = value; } } [Fx.Tag.SecurityNote(Critical = "Calls the critical methods of PartialTrustHelpers", Safe = "PartialTrustHelpers.IsInFullTrust demands for FullTrust")] [SecuritySafeCritical] 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(!PartialTrustHelpers.IsInFullTrust()) { throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigDataContractSerializerSectionLoadError))); } } } } // 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
- TdsValueSetter.cs
- GestureRecognizer.cs
- Column.cs
- NonSerializedAttribute.cs
- BufferModeSettings.cs
- NameValueFileSectionHandler.cs
- AspNetSynchronizationContext.cs
- StylusPointPropertyId.cs
- DecoderExceptionFallback.cs
- XamlBuildProvider.cs
- ArgIterator.cs
- UnionCqlBlock.cs
- ProfileEventArgs.cs
- COM2PropertyDescriptor.cs
- ActivityExecutorOperation.cs
- JsonReaderWriterFactory.cs
- ContextActivityUtils.cs
- IdleTimeoutMonitor.cs
- CodeBinaryOperatorExpression.cs
- XmlDigitalSignatureProcessor.cs
- ClaimTypes.cs
- ChangeTracker.cs
- HttpWebRequestElement.cs
- ObjectPersistData.cs
- SkinBuilder.cs
- CustomLineCap.cs
- DataGridCommandEventArgs.cs
- RequestSecurityTokenResponse.cs
- ZoneLinkButton.cs
- SafeCoTaskMem.cs
- CommandBindingCollection.cs
- shaper.cs
- DeobfuscatingStream.cs
- Part.cs
- LocationUpdates.cs
- ReadWriteSpinLock.cs
- SafeFileMappingHandle.cs
- JpegBitmapDecoder.cs
- CollectionViewSource.cs
- TreeNodeMouseHoverEvent.cs
- TabletDeviceInfo.cs
- SetterBaseCollection.cs
- DiscardableAttribute.cs
- ImageMap.cs
- WebDisplayNameAttribute.cs
- ContainerControlDesigner.cs
- EntityContainerEmitter.cs
- AdRotatorDesigner.cs
- BuildProviderCollection.cs
- MembershipUser.cs
- SerializationHelper.cs
- PersonalizationStateInfoCollection.cs
- DateTimeFormatInfo.cs
- WebPartDisplayModeEventArgs.cs
- WeakReferenceKey.cs
- DateTimeValueSerializer.cs
- WindowsSlider.cs
- ImageDrawing.cs
- URLEditor.cs
- KeysConverter.cs
- DefaultClaimSet.cs
- OdbcHandle.cs
- NamedPipeHostedTransportConfiguration.cs
- DBNull.cs
- XmlSchemaSimpleTypeRestriction.cs
- NetworkAddressChange.cs
- Tool.cs
- TransactionInterop.cs
- HandledMouseEvent.cs
- StreamGeometryContext.cs
- TitleStyle.cs
- SecurityResources.cs
- GlyphingCache.cs
- UInt64.cs
- RequestCacheEntry.cs
- XmlSiteMapProvider.cs
- WeakReferenceKey.cs
- FileVersionInfo.cs
- DataBoundControl.cs
- DataGridCellsPresenter.cs
- xmlglyphRunInfo.cs
- PropertyGeneratedEventArgs.cs
- TextStore.cs
- SqlReferenceCollection.cs
- SystemIPGlobalStatistics.cs
- IMembershipProvider.cs
- WebPartCatalogCloseVerb.cs
- AccessKeyManager.cs
- DateTimeSerializationSection.cs
- ValueChangedEventManager.cs
- RtfToXamlReader.cs
- returneventsaver.cs
- MemberDomainMap.cs
- DesignerCategoryAttribute.cs
- UnmanagedBitmapWrapper.cs
- InheritanceContextHelper.cs
- HwndHostAutomationPeer.cs
- CardSpaceException.cs
- WindowCollection.cs
- CellParaClient.cs