Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Markup / XamlDesignerSerializationManager.cs / 1 / XamlDesignerSerializationManager.cs
//---------------------------------------------------------------------------- // // File: XamlDesignerSerializationManager.cs // // Description: // Manages the ContextStack for a particular run of Serialization. // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using System.Xml; namespace System.Windows.Markup { ////// The serialization manager offers three services /// 1. To store all of the context information /// for the current run of serialization on a stack. /// 2. To query a given type for its serializer. /// 3. To get and set the serialization mode for /// a given Expression type /// ////// As a measure of optimization it also /// maintains a cache mapping types to /// serializers, to avoid the overhead of /// reflecting for the attribute on every /// query. /// /// /// // public class XamlDesignerSerializationManager : ServiceProviders { #region Construction ////// Constructor for XamlDesignerSerializationManager /// /// /// XmlWriter /// public XamlDesignerSerializationManager(XmlWriter xmlWriter) { _xamlWriterMode = XamlWriterMode.Value; _xmlWriter = xmlWriter; } #endregion Construction #region Properties ////// The mode of serialization for /// all Expressions /// public XamlWriterMode XamlWriterMode { get { return _xamlWriterMode; } set { // Validate Input Arguments if (!IsValidXamlWriterMode(value)) { throw new InvalidEnumArgumentException("value", (int)value, typeof(XamlWriterMode)); } _xamlWriterMode = value; } } ////// XmlWriter /// internal XmlWriter XmlWriter { get { return _xmlWriter; } } #endregion Properties #region Internal Methods internal void ClearXmlWriter() { _xmlWriter = null; } #endregion #region Private Methods private static bool IsValidXamlWriterMode(XamlWriterMode value) { return value == XamlWriterMode.Value || value == XamlWriterMode.Expression; } #endregion #region Data private XamlWriterMode _xamlWriterMode; // Serialization modes private XmlWriter _xmlWriter; //XmlWriter #endregion Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: XamlDesignerSerializationManager.cs // // Description: // Manages the ContextStack for a particular run of Serialization. // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using System.Xml; namespace System.Windows.Markup { ////// The serialization manager offers three services /// 1. To store all of the context information /// for the current run of serialization on a stack. /// 2. To query a given type for its serializer. /// 3. To get and set the serialization mode for /// a given Expression type /// ////// As a measure of optimization it also /// maintains a cache mapping types to /// serializers, to avoid the overhead of /// reflecting for the attribute on every /// query. /// /// /// // public class XamlDesignerSerializationManager : ServiceProviders { #region Construction ////// Constructor for XamlDesignerSerializationManager /// /// /// XmlWriter /// public XamlDesignerSerializationManager(XmlWriter xmlWriter) { _xamlWriterMode = XamlWriterMode.Value; _xmlWriter = xmlWriter; } #endregion Construction #region Properties ////// The mode of serialization for /// all Expressions /// public XamlWriterMode XamlWriterMode { get { return _xamlWriterMode; } set { // Validate Input Arguments if (!IsValidXamlWriterMode(value)) { throw new InvalidEnumArgumentException("value", (int)value, typeof(XamlWriterMode)); } _xamlWriterMode = value; } } ////// XmlWriter /// internal XmlWriter XmlWriter { get { return _xmlWriter; } } #endregion Properties #region Internal Methods internal void ClearXmlWriter() { _xmlWriter = null; } #endregion #region Private Methods private static bool IsValidXamlWriterMode(XamlWriterMode value) { return value == XamlWriterMode.Value || value == XamlWriterMode.Expression; } #endregion #region Data private XamlWriterMode _xamlWriterMode; // Serialization modes private XmlWriter _xmlWriter; //XmlWriter #endregion Data } } // 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
- BitmapEffectInput.cs
- InnerItemCollectionView.cs
- Authorization.cs
- PreviewKeyDownEventArgs.cs
- DataColumn.cs
- AutoCompleteStringCollection.cs
- TCPClient.cs
- UInt16.cs
- DataListItemCollection.cs
- RNGCryptoServiceProvider.cs
- RIPEMD160.cs
- ResponseStream.cs
- ColorMatrix.cs
- PageContent.cs
- ClipboardProcessor.cs
- SettingsBindableAttribute.cs
- QilInvokeLateBound.cs
- CommunicationObject.cs
- XmlSerializer.cs
- WsdlServiceChannelBuilder.cs
- CodeArrayCreateExpression.cs
- Image.cs
- Trigger.cs
- DocumentViewer.cs
- entitydatasourceentitysetnameconverter.cs
- Scheduler.cs
- CircleHotSpot.cs
- RegularExpressionValidator.cs
- SqlClientWrapperSmiStreamChars.cs
- ExponentialEase.cs
- SqlCacheDependencySection.cs
- WindowsClaimSet.cs
- Size.cs
- Int64.cs
- _ScatterGatherBuffers.cs
- NetMsmqSecurity.cs
- CultureSpecificCharacterBufferRange.cs
- Html32TextWriter.cs
- NullPackagingPolicy.cs
- COM2PropertyPageUITypeConverter.cs
- PathStreamGeometryContext.cs
- PropertyMetadata.cs
- DataRowComparer.cs
- StylesEditorDialog.cs
- UTF7Encoding.cs
- Wildcard.cs
- PersonalizableAttribute.cs
- InvokeGenerator.cs
- MultiAsyncResult.cs
- WindowExtensionMethods.cs
- Closure.cs
- DynamicResourceExtensionConverter.cs
- SqlDataSourceStatusEventArgs.cs
- DodSequenceMerge.cs
- ColumnClickEvent.cs
- ScriptIgnoreAttribute.cs
- RequestUriProcessor.cs
- ConnectionsZone.cs
- SystemResourceKey.cs
- DataGridViewRow.cs
- BinaryConverter.cs
- SubtreeProcessor.cs
- ClientConfigurationHost.cs
- Matrix.cs
- ExceptionHandler.cs
- MemoryFailPoint.cs
- EntityProxyTypeInfo.cs
- EntityCollectionChangedParams.cs
- controlskin.cs
- ClientOptions.cs
- _PooledStream.cs
- LZCodec.cs
- WebControlParameterProxy.cs
- XamlStream.cs
- ListComponentEditor.cs
- HttpListenerException.cs
- SystemPens.cs
- QueryExpr.cs
- LineGeometry.cs
- ObjectSecurity.cs
- DateTimeOffset.cs
- XmlNavigatorFilter.cs
- FreezableDefaultValueFactory.cs
- IIS7UserPrincipal.cs
- Size3DConverter.cs
- BaseTransportHeaders.cs
- BaseComponentEditor.cs
- CompleteWizardStep.cs
- GPPOINTF.cs
- SecurityPermission.cs
- ListItemCollection.cs
- Permission.cs
- ClockGroup.cs
- SqlUDTStorage.cs
- ConnectionPoint.cs
- Deflater.cs
- ServerValidateEventArgs.cs
- MapPathBasedVirtualPathProvider.cs
- OdbcCommand.cs
- EventPropertyMap.cs