Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Serialization / System / Runtime / Serialization / SpecialTypeDataContract.cs / 1305376 / SpecialTypeDataContract.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Runtime.Serialization { using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Security; sealed class SpecialTypeDataContract : DataContract { [Fx.Tag.SecurityNote(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; [Fx.Tag.SecurityNote(Critical = "Initializes SecurityCritical field 'helper'.", Safe = "Doesn't leak anything.")] [SecuritySafeCritical] public SpecialTypeDataContract(Type type) : base(new SpecialTypeDataContractCriticalHelper(type)) { helper = base.Helper as SpecialTypeDataContractCriticalHelper; } [Fx.Tag.SecurityNote(Critical = "Initializes SecurityCritical field 'helper'.", Safe = "Doesn't leak anything.")] [SecuritySafeCritical] 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; } } [Fx.Tag.SecurityNote(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. //----------------------------------------------------------------------------- namespace System.Runtime.Serialization { using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Security; sealed class SpecialTypeDataContract : DataContract { [Fx.Tag.SecurityNote(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; [Fx.Tag.SecurityNote(Critical = "Initializes SecurityCritical field 'helper'.", Safe = "Doesn't leak anything.")] [SecuritySafeCritical] public SpecialTypeDataContract(Type type) : base(new SpecialTypeDataContractCriticalHelper(type)) { helper = base.Helper as SpecialTypeDataContractCriticalHelper; } [Fx.Tag.SecurityNote(Critical = "Initializes SecurityCritical field 'helper'.", Safe = "Doesn't leak anything.")] [SecuritySafeCritical] 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; } } [Fx.Tag.SecurityNote(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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UserControlParser.cs
- ButtonAutomationPeer.cs
- WebControlParameterProxy.cs
- Literal.cs
- cookie.cs
- CompositeControl.cs
- followingsibling.cs
- _ConnectionGroup.cs
- SqlSelectStatement.cs
- HandlerElement.cs
- BufferManager.cs
- Tokenizer.cs
- ComplexBindingPropertiesAttribute.cs
- ParseChildrenAsPropertiesAttribute.cs
- FlowSwitchDesigner.xaml.cs
- Token.cs
- WebPartManager.cs
- TransactionManager.cs
- MatrixTransform.cs
- StdRegProviderWrapper.cs
- GlobalizationAssembly.cs
- TextEditorTyping.cs
- TagPrefixAttribute.cs
- MarkupProperty.cs
- AsyncCompletedEventArgs.cs
- PrimitiveCodeDomSerializer.cs
- TextRange.cs
- BasicHttpBindingElement.cs
- NumericUpDown.cs
- BuilderElements.cs
- OleDbDataReader.cs
- Rect3DValueSerializer.cs
- UnsafeNativeMethods.cs
- FileSystemWatcher.cs
- HttpRuntime.cs
- CodeIdentifiers.cs
- DbDeleteCommandTree.cs
- XmlSchemaProviderAttribute.cs
- CachedBitmap.cs
- GPRECT.cs
- PageCache.cs
- TextRangeProviderWrapper.cs
- XmlAggregates.cs
- PresentationSource.cs
- CustomWebEventKey.cs
- Win32KeyboardDevice.cs
- ServiceInfoCollection.cs
- CounterSetInstance.cs
- Blend.cs
- PromptBuilder.cs
- EventBuilder.cs
- EntityDataSourceWizardForm.cs
- PrivateFontCollection.cs
- CodeCommentStatementCollection.cs
- AutomationPeer.cs
- StateInitialization.cs
- figurelength.cs
- SectionUpdates.cs
- _DynamicWinsockMethods.cs
- SEHException.cs
- VectorCollectionConverter.cs
- PingOptions.cs
- TextBoxDesigner.cs
- StrokeCollection2.cs
- InternalConfigEventArgs.cs
- BitmapEffectDrawingContextWalker.cs
- ResourceContainerWrapper.cs
- bidPrivateBase.cs
- Property.cs
- PairComparer.cs
- ToolStripGrip.cs
- DataBindingHandlerAttribute.cs
- SiteMap.cs
- CompleteWizardStep.cs
- XmlTextReaderImpl.cs
- ReachFixedPageSerializer.cs
- XmlReflectionMember.cs
- FacetDescriptionElement.cs
- TreeBuilder.cs
- SqlNamer.cs
- X509CertificateChain.cs
- StyleHelper.cs
- CommandField.cs
- CodeDomDecompiler.cs
- FileIOPermission.cs
- Variable.cs
- ProxyWebPartManager.cs
- OleDbCommand.cs
- BypassElement.cs
- TypeGeneratedEventArgs.cs
- PersonalizationEntry.cs
- StateMachineSubscriptionManager.cs
- TitleStyle.cs
- _DigestClient.cs
- WaitingCursor.cs
- COM2Properties.cs
- ClientSettings.cs
- RotateTransform3D.cs
- LongTypeConverter.cs
- CleanUpVirtualizedItemEventArgs.cs