Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Serialization / System / Runtime / Serialization / SpecialTypeDataContract.cs / 1 / SpecialTypeDataContract.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Security; namespace System.Runtime.Serialization { internal sealed class SpecialTypeDataContract : DataContract { ////// Critical - holds instance of CriticalHelper which keeps state that is cached statically for serialization. /// Static fields are marked SecurityCritical or readonly to prevent /// data from being modified or leaked to other components in appdomain. /// [SecurityCritical] SpecialTypeDataContractCriticalHelper helper; ////// Critical - initializes SecurityCritical field 'helper' /// Safe - doesn't leak anything /// [SecurityCritical, SecurityTreatAsSafe] public SpecialTypeDataContract(Type type) : base(new SpecialTypeDataContractCriticalHelper(type)) { helper = base.Helper as SpecialTypeDataContractCriticalHelper; } ////// Critical - initializes SecurityCritical field 'helper' /// Safe - doesn't leak anything /// [SecurityCritical, SecurityTreatAsSafe] public SpecialTypeDataContract(Type type, XmlDictionaryString name, XmlDictionaryString ns) : base(new SpecialTypeDataContractCriticalHelper(type, name, ns)) { helper = base.Helper as SpecialTypeDataContractCriticalHelper; } internal override bool IsBuiltInDataContract { get { return true; } } ////// Critical - holds all state used for for (de)serializing known types like System.Enum, System.ValueType, etc. /// since the data is cached statically, we lock down access to it. /// [SecurityCritical(SecurityCriticalScope.Everything)] class SpecialTypeDataContractCriticalHelper : DataContract.DataContractCriticalHelper { internal SpecialTypeDataContractCriticalHelper(Type type) : base(type) { } internal SpecialTypeDataContractCriticalHelper(Type type, XmlDictionaryString name, XmlDictionaryString ns) : base(type) { SetDataContractName(name, ns); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CircleHotSpot.cs
- DbConvert.cs
- SafeEventLogReadHandle.cs
- ValidatorCollection.cs
- VectorAnimation.cs
- ComponentResourceKeyConverter.cs
- CorrelationQuery.cs
- BindingContext.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- MouseButton.cs
- BaseCodeDomTreeGenerator.cs
- Parameter.cs
- EnumBuilder.cs
- SqlDependency.cs
- LicenseManager.cs
- DataKey.cs
- TextRange.cs
- Quaternion.cs
- x509store.cs
- IconEditor.cs
- CompiledRegexRunnerFactory.cs
- TypeDescriptionProviderAttribute.cs
- DefaultHttpHandler.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- TagPrefixCollection.cs
- CodeObjectCreateExpression.cs
- ResourceIDHelper.cs
- XPathAncestorQuery.cs
- ScrollBar.cs
- TransformGroup.cs
- DispatcherHooks.cs
- IIS7WorkerRequest.cs
- ControlUtil.cs
- FileSecurity.cs
- WebResourceUtil.cs
- SoapTypeAttribute.cs
- UnauthorizedWebPart.cs
- Material.cs
- IImplicitResourceProvider.cs
- PropertyInformation.cs
- ApplyTemplatesAction.cs
- Authorization.cs
- Material.cs
- SecureStringHasher.cs
- DefaultValidator.cs
- ViewBase.cs
- SoapExtensionTypeElement.cs
- HMAC.cs
- ScalarConstant.cs
- PropertyGrid.cs
- DataGridTextBoxColumn.cs
- TriggerCollection.cs
- CodeTypeMemberCollection.cs
- Tuple.cs
- WebPartCancelEventArgs.cs
- webbrowsersite.cs
- RemotingAttributes.cs
- ContactManager.cs
- ColumnWidthChangingEvent.cs
- Stack.cs
- PassportPrincipal.cs
- BooleanConverter.cs
- TiffBitmapDecoder.cs
- LinkedList.cs
- PrintingPermissionAttribute.cs
- CodeDOMProvider.cs
- ParentQuery.cs
- _IPv6Address.cs
- MessageOperationFormatter.cs
- cryptoapiTransform.cs
- VectorValueSerializer.cs
- AssemblyName.cs
- UnsafeNativeMethodsPenimc.cs
- InstanceNormalEvent.cs
- RtfToXamlReader.cs
- ForwardPositionQuery.cs
- SizeConverter.cs
- _NegotiateClient.cs
- SolidColorBrush.cs
- ContainerAction.cs
- XPathDescendantIterator.cs
- ListDictionaryInternal.cs
- TransportContext.cs
- TrackingMemoryStreamFactory.cs
- SessionEndingCancelEventArgs.cs
- Int32CAMarshaler.cs
- BamlResourceDeserializer.cs
- WebPartDescriptionCollection.cs
- ApplicationSecurityManager.cs
- DataContractSerializerServiceBehavior.cs
- ReferenceEqualityComparer.cs
- Drawing.cs
- AssemblyAttributes.cs
- FormattedText.cs
- DbConnectionPoolIdentity.cs
- PageAsyncTask.cs
- SQLRoleProvider.cs
- DataComponentMethodGenerator.cs
- nulltextnavigator.cs
- PolicyValidationException.cs