Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Base64Stream.cs
- DateTimePicker.cs
- LineGeometry.cs
- ResXResourceReader.cs
- ConfigDefinitionUpdates.cs
- ListBoxDesigner.cs
- EventDescriptor.cs
- StrokeDescriptor.cs
- Color.cs
- ProfileEventArgs.cs
- IConvertible.cs
- MediaContext.cs
- DependencyPropertyKind.cs
- DataSet.cs
- SettingsProperty.cs
- Camera.cs
- ValidationError.cs
- DesigntimeLicenseContextSerializer.cs
- EntityDataSourceContextDisposingEventArgs.cs
- AttachedProperty.cs
- SyntaxCheck.cs
- DragStartedEventArgs.cs
- AssemblyUtil.cs
- PropertyValidationContext.cs
- LinkClickEvent.cs
- PropertyInfo.cs
- SubMenuStyleCollectionEditor.cs
- SignerInfo.cs
- WindowClosedEventArgs.cs
- EntityDataSourceValidationException.cs
- SecuritySessionSecurityTokenProvider.cs
- DragEventArgs.cs
- SingleConverter.cs
- ImageFormatConverter.cs
- SwitchElementsCollection.cs
- UpDownEvent.cs
- ActivityDesignerHelper.cs
- PageBuildProvider.cs
- SimplePropertyEntry.cs
- MbpInfo.cs
- SapiInterop.cs
- Adorner.cs
- HtmlInputFile.cs
- SqlDataSourceQueryEditor.cs
- DesignerOptionService.cs
- WebPartMenuStyle.cs
- InputBinding.cs
- OleAutBinder.cs
- ClientSideQueueItem.cs
- LocalizationParserHooks.cs
- FixedPosition.cs
- LogReserveAndAppendState.cs
- LogicalChannelCollection.cs
- NameSpaceEvent.cs
- RightsManagementPermission.cs
- AccessDataSourceView.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- TabRenderer.cs
- KnownBoxes.cs
- TextMarkerSource.cs
- SecurityTokenRequirement.cs
- UnsafeNativeMethods.cs
- GZipDecoder.cs
- PixelShader.cs
- RadioButtonPopupAdapter.cs
- DesignerLoader.cs
- Publisher.cs
- DynamicDataManager.cs
- RelationshipConstraintValidator.cs
- XmlReflectionMember.cs
- PassportPrincipal.cs
- OleAutBinder.cs
- PageThemeParser.cs
- SeparatorAutomationPeer.cs
- TCPListener.cs
- ConnectionStringEditor.cs
- XmlLinkedNode.cs
- RubberbandSelector.cs
- SafeProcessHandle.cs
- PeerCollaboration.cs
- HttpApplication.cs
- Base64Decoder.cs
- XmlQueryTypeFactory.cs
- ListViewItem.cs
- Helpers.cs
- CacheSection.cs
- AttributeCollection.cs
- MaskedTextBoxTextEditorDropDown.cs
- BamlRecordReader.cs
- LocalsItemDescription.cs
- RuleRefElement.cs
- SqlDataReaderSmi.cs
- StringPropertyBuilder.cs
- BidPrivateBase.cs
- returneventsaver.cs
- TableLayout.cs
- DbConnectionOptions.cs
- UpdateTracker.cs
- CLRBindingWorker.cs
- ListBoxItemAutomationPeer.cs