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
- ExceptionWrapper.cs
- Int32Converter.cs
- ISFTagAndGuidCache.cs
- ExpressionBindingCollection.cs
- RichTextBoxConstants.cs
- Matrix.cs
- XmlSchemaObject.cs
- EntityConnectionStringBuilder.cs
- DbParameterHelper.cs
- MsmqIntegrationElement.cs
- ParameterRefs.cs
- EmissiveMaterial.cs
- ObjectSecurityT.cs
- ToolStripItem.cs
- CngKeyCreationParameters.cs
- WebPartMenuStyle.cs
- SqlNamer.cs
- IsolatedStorageException.cs
- DBSqlParserTableCollection.cs
- SymmetricKey.cs
- CapabilitiesRule.cs
- FlowNode.cs
- CodeArrayIndexerExpression.cs
- Decorator.cs
- NullRuntimeConfig.cs
- WebSysDefaultValueAttribute.cs
- IdleTimeoutMonitor.cs
- SizeChangedEventArgs.cs
- EventEntry.cs
- HandlerBase.cs
- DataGridTablesFactory.cs
- TextContainerChangedEventArgs.cs
- OdbcParameter.cs
- SpellerInterop.cs
- LayoutTable.cs
- IItemContainerGenerator.cs
- TableLayoutStyle.cs
- DataGridItemEventArgs.cs
- RectAnimationUsingKeyFrames.cs
- BitmapVisualManager.cs
- TypeToStringValueConverter.cs
- XmlRawWriter.cs
- _UncName.cs
- OleDbDataReader.cs
- BinHexDecoder.cs
- InheritablePropertyChangeInfo.cs
- WebPartMenuStyle.cs
- HMACSHA512.cs
- HttpTransportElement.cs
- ToolStripButton.cs
- HtmlTableCell.cs
- ProcessInfo.cs
- HttpRequestBase.cs
- HandleCollector.cs
- bidPrivateBase.cs
- ToolStripActionList.cs
- BrowserCapabilitiesCompiler.cs
- EmptyQuery.cs
- ListCommandEventArgs.cs
- FaultDesigner.cs
- EdmProviderManifest.cs
- DataRowExtensions.cs
- CultureTableRecord.cs
- ElementAtQueryOperator.cs
- CommandSet.cs
- SizeConverter.cs
- DbBuffer.cs
- JoinElimination.cs
- Itemizer.cs
- WebException.cs
- WebConfigurationFileMap.cs
- TrustManagerMoreInformation.cs
- TypeConverterAttribute.cs
- ISFClipboardData.cs
- SendMailErrorEventArgs.cs
- WebPartCancelEventArgs.cs
- LogicalChannel.cs
- DataStreams.cs
- UInt64.cs
- TabControlAutomationPeer.cs
- SizeChangedEventArgs.cs
- BitmapEffectState.cs
- PathGeometry.cs
- ClrPerspective.cs
- CursorConverter.cs
- SizeAnimationBase.cs
- AspNetPartialTrustHelpers.cs
- HttpWriter.cs
- X509CertificateCollection.cs
- CellParaClient.cs
- ResponseStream.cs
- PeerCollaborationPermission.cs
- ZipIOExtraFieldElement.cs
- ButtonRenderer.cs
- CheckBoxBaseAdapter.cs
- SmiContextFactory.cs
- HttpPostClientProtocol.cs
- BehaviorEditorPart.cs
- RotateTransform.cs
- PolyBezierSegment.cs