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
- Accessible.cs
- FixedMaxHeap.cs
- NavigationWindow.cs
- XmlSchemaRedefine.cs
- DocumentStream.cs
- VisualStyleInformation.cs
- BindingObserver.cs
- ValidatedControlConverter.cs
- VectorAnimationUsingKeyFrames.cs
- XPathSelectionIterator.cs
- _LocalDataStore.cs
- TableLayoutSettingsTypeConverter.cs
- ActivationArguments.cs
- DateTime.cs
- ColorConvertedBitmapExtension.cs
- WebConfigurationFileMap.cs
- Trace.cs
- Message.cs
- CharacterMetricsDictionary.cs
- CompleteWizardStep.cs
- Double.cs
- SequenceDesignerAccessibleObject.cs
- DetailsViewRowCollection.cs
- QilChoice.cs
- PrintDialogException.cs
- PropertyRecord.cs
- ParserExtension.cs
- ApplicationException.cs
- SequenceRangeCollection.cs
- Storyboard.cs
- SpanIndex.cs
- DBPropSet.cs
- CryptoApi.cs
- HttpModuleCollection.cs
- VariantWrapper.cs
- DynamicDocumentPaginator.cs
- CellTreeNodeVisitors.cs
- TabControlAutomationPeer.cs
- ProfileEventArgs.cs
- LoadedOrUnloadedOperation.cs
- DelegateHelpers.cs
- UnorderedHashRepartitionStream.cs
- ThemeableAttribute.cs
- EntityDataSourceState.cs
- MailDefinitionBodyFileNameEditor.cs
- ReferentialConstraintRoleElement.cs
- BufferedOutputStream.cs
- XmlSubtreeReader.cs
- MethodCallExpression.cs
- SqlResolver.cs
- RecognizerInfo.cs
- MsmqIntegrationMessageProperty.cs
- ObjectDataSourceMethodEventArgs.cs
- DoubleAnimationUsingPath.cs
- RijndaelManagedTransform.cs
- RouteData.cs
- Rectangle.cs
- ValueTypeFixupInfo.cs
- CounterSample.cs
- Splitter.cs
- EventToken.cs
- DataSourceCache.cs
- NameTable.cs
- LockRecursionException.cs
- Attribute.cs
- SafeBitVector32.cs
- WorkflowServiceBehavior.cs
- Blend.cs
- _NegoStream.cs
- TransformPattern.cs
- ScriptControl.cs
- DataControlPagerLinkButton.cs
- VisualStyleElement.cs
- DataGridSortingEventArgs.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- MenuRenderer.cs
- WriteLineDesigner.xaml.cs
- EventEntry.cs
- StylusPointPropertyId.cs
- BufferModesCollection.cs
- FormViewRow.cs
- InvalidCastException.cs
- ToolStripSettings.cs
- PrintPreviewDialog.cs
- SoapBinding.cs
- XmlAttributeOverrides.cs
- DataAdapter.cs
- TransactionInterop.cs
- TreeViewDesigner.cs
- COM2IDispatchConverter.cs
- GcSettings.cs
- sqlcontext.cs
- MenuScrollingVisibilityConverter.cs
- Internal.cs
- XmlDeclaration.cs
- DiscoveryOperationContextExtension.cs
- EntityParameterCollection.cs
- SmtpNetworkElement.cs
- ConfigsHelper.cs
- FieldNameLookup.cs