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
- ExceptionUtility.cs
- TextEditorThreadLocalStore.cs
- StreamWithDictionary.cs
- VariableReference.cs
- ClientRuntimeConfig.cs
- OutgoingWebResponseContext.cs
- ComplexPropertyEntry.cs
- HiddenFieldPageStatePersister.cs
- SqlRetyper.cs
- SqlCaseSimplifier.cs
- ContainerUIElement3D.cs
- OpCodes.cs
- OracleException.cs
- WebServiceReceive.cs
- ScriptingRoleServiceSection.cs
- DataGridViewCellValueEventArgs.cs
- DesignerLoader.cs
- XmlSchemaInclude.cs
- StateWorkerRequest.cs
- InvalidEnumArgumentException.cs
- sqlmetadatafactory.cs
- TextEndOfSegment.cs
- DetailsViewUpdateEventArgs.cs
- MarshalByValueComponent.cs
- CommandTreeTypeHelper.cs
- DataBindingCollectionConverter.cs
- SQLChars.cs
- ResourceContainerWrapper.cs
- ValidatorCompatibilityHelper.cs
- MultiView.cs
- EntityConnectionStringBuilderItem.cs
- IPipelineRuntime.cs
- DeviceFilterDictionary.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- EnvelopedSignatureTransform.cs
- TdsEnums.cs
- DrawToolTipEventArgs.cs
- TagPrefixCollection.cs
- SiteMap.cs
- loginstatus.cs
- TextElementEnumerator.cs
- AppLevelCompilationSectionCache.cs
- ValidationPropertyAttribute.cs
- GregorianCalendar.cs
- XmlSchema.cs
- TextEditorThreadLocalStore.cs
- OleDbReferenceCollection.cs
- Range.cs
- ClientScriptManager.cs
- WhitespaceRuleLookup.cs
- SettingsAttributeDictionary.cs
- SafeHandle.cs
- ReadOnlyHierarchicalDataSource.cs
- BooleanProjectedSlot.cs
- DataComponentMethodGenerator.cs
- PopupRootAutomationPeer.cs
- TemplateControlParser.cs
- HttpApplicationFactory.cs
- DataBindingHandlerAttribute.cs
- TcpClientCredentialType.cs
- LogLogRecordHeader.cs
- TraceContextEventArgs.cs
- MetadataItemCollectionFactory.cs
- Vector3D.cs
- GuidelineSet.cs
- BufferedWebEventProvider.cs
- ConfigurationValidatorBase.cs
- ButtonFieldBase.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- SynchronizationLockException.cs
- XmlDataSourceView.cs
- QueryMath.cs
- LinkedResource.cs
- SystemColors.cs
- WhereQueryOperator.cs
- ArrayItemValue.cs
- FormsAuthenticationTicket.cs
- DesignerAttributeInfo.cs
- CopyOnWriteList.cs
- TriggerAction.cs
- DataGridLengthConverter.cs
- Calendar.cs
- XamlSerializer.cs
- TextElementCollection.cs
- ConfigXmlText.cs
- ResolvedKeyFrameEntry.cs
- RichTextBox.cs
- Translator.cs
- CookieProtection.cs
- WebPartTransformerCollection.cs
- KnownAssembliesSet.cs
- QueryComponents.cs
- ArrayElementGridEntry.cs
- ZipIOLocalFileDataDescriptor.cs
- XmlLoader.cs
- SerializationSectionGroup.cs
- ScrollChangedEventArgs.cs
- CodeDelegateCreateExpression.cs
- SectionRecord.cs