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
- SchemaNamespaceManager.cs
- CreatingCookieEventArgs.cs
- KeyInterop.cs
- DbFunctionCommandTree.cs
- BooleanSwitch.cs
- XamlReaderHelper.cs
- FontFaceLayoutInfo.cs
- PartDesigner.cs
- ListViewGroupConverter.cs
- MulticastDelegate.cs
- dtdvalidator.cs
- BCryptSafeHandles.cs
- AnnotationMap.cs
- SmiContext.cs
- CodeExpressionStatement.cs
- TextBoxAutoCompleteSourceConverter.cs
- TextServicesCompartmentEventSink.cs
- UnsafeNativeMethodsCLR.cs
- unsafeIndexingFilterStream.cs
- ClassDataContract.cs
- Int32Rect.cs
- PasswordBoxAutomationPeer.cs
- ButtonChrome.cs
- FixedFlowMap.cs
- Configuration.cs
- SmtpFailedRecipientsException.cs
- KeyValuePair.cs
- NullableLongSumAggregationOperator.cs
- TrackBarRenderer.cs
- XmlMembersMapping.cs
- LockCookie.cs
- TypedColumnHandler.cs
- WebPartDisplayModeEventArgs.cs
- FileSystemEventArgs.cs
- CodeSubDirectoriesCollection.cs
- PublishLicense.cs
- ArgIterator.cs
- OleStrCAMarshaler.cs
- TileBrush.cs
- DiscoveryClientReferences.cs
- ServiceModelConfigurationSectionCollection.cs
- SiteMapPath.cs
- FileInfo.cs
- SerializationSectionGroup.cs
- MenuItemCollection.cs
- SpellerStatusTable.cs
- XPathDescendantIterator.cs
- unitconverter.cs
- ToolBar.cs
- SizeAnimationBase.cs
- ToolStripLabel.cs
- ComplexPropertyEntry.cs
- PrintDialog.cs
- OleCmdHelper.cs
- Size.cs
- PopupEventArgs.cs
- GcSettings.cs
- SupportsEventValidationAttribute.cs
- ReadWriteObjectLock.cs
- MulticastDelegate.cs
- CancellationState.cs
- SQLDoubleStorage.cs
- PointAnimationClockResource.cs
- DefaultPropertiesToSend.cs
- Page.cs
- ReaderContextStackData.cs
- StatusBar.cs
- ComplexPropertyEntry.cs
- CustomMenuItemCollection.cs
- PreparingEnlistment.cs
- ObjectDesignerDataSourceView.cs
- XmlArrayItemAttribute.cs
- Tile.cs
- TextPointerBase.cs
- RubberbandSelector.cs
- ReceiveErrorHandling.cs
- ColumnReorderedEventArgs.cs
- Slider.cs
- ExpressionBuilderCollection.cs
- OrCondition.cs
- PaintValueEventArgs.cs
- CheckedListBox.cs
- XmlSiteMapProvider.cs
- HtmlElement.cs
- Base64Decoder.cs
- CommonDialog.cs
- SelectionListDesigner.cs
- Underline.cs
- SessionIDManager.cs
- CodeDirectoryCompiler.cs
- FilterElement.cs
- TrackingProfileSerializer.cs
- XmlnsDefinitionAttribute.cs
- DataTemplateSelector.cs
- HWStack.cs
- UnsafeNativeMethods.cs
- AsnEncodedData.cs
- UnionCqlBlock.cs
- PersistStreamTypeWrapper.cs
- IgnoreSection.cs