Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- HttpWebRequestElement.cs
- brushes.cs
- XmlDigitalSignatureProcessor.cs
- ListView.cs
- TableLayoutStyleCollection.cs
- HttpWebRequestElement.cs
- LingerOption.cs
- ISCIIEncoding.cs
- ControllableStoryboardAction.cs
- EventProviderWriter.cs
- PublisherIdentityPermission.cs
- Vector3DCollection.cs
- UrlMappingsModule.cs
- WebPartEditVerb.cs
- TimerElapsedEvenArgs.cs
- ZipPackage.cs
- Pair.cs
- ToolStripContentPanelRenderEventArgs.cs
- VisualStyleElement.cs
- EntityClassGenerator.cs
- EventlogProvider.cs
- Repeater.cs
- DbConnectionStringCommon.cs
- TrustManagerPromptUI.cs
- TreeNodeBinding.cs
- ComponentEditorPage.cs
- DefaultSection.cs
- InheritanceService.cs
- SlotInfo.cs
- ResourceReferenceExpression.cs
- SafeUserTokenHandle.cs
- OletxResourceManager.cs
- QualifiedCellIdBoolean.cs
- DateRangeEvent.cs
- InputQueue.cs
- NullEntityWrapper.cs
- DefinitionUpdate.cs
- ColorInterpolationModeValidation.cs
- RuntimeIdentifierPropertyAttribute.cs
- OrthographicCamera.cs
- TreeViewItem.cs
- MarkupCompiler.cs
- AssemblyBuilderData.cs
- CustomDictionarySources.cs
- DoubleLinkListEnumerator.cs
- PrefixQName.cs
- PrtCap_Base.cs
- RegionInfo.cs
- SecureUICommand.cs
- BaseDataBoundControlDesigner.cs
- AnnouncementInnerClientCD1.cs
- DictionaryEntry.cs
- EnumValidator.cs
- ZipIOCentralDirectoryFileHeader.cs
- HitTestParameters3D.cs
- PersonalizationProvider.cs
- CqlQuery.cs
- NumericUpDown.cs
- GestureRecognizer.cs
- Triangle.cs
- ParallelDesigner.xaml.cs
- ListViewInsertedEventArgs.cs
- SafeHandle.cs
- DataReceivedEventArgs.cs
- RangeBaseAutomationPeer.cs
- DataListItemCollection.cs
- ObjectTag.cs
- DataServiceStreamProviderWrapper.cs
- CapabilitiesUse.cs
- ManagedFilter.cs
- DriveInfo.cs
- WebBrowserUriTypeConverter.cs
- SoapSchemaImporter.cs
- CryptographicAttribute.cs
- TripleDES.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- ComponentDispatcher.cs
- ValueSerializerAttribute.cs
- DbProviderManifest.cs
- LazyTextWriterCreator.cs
- SemanticResultValue.cs
- VerticalAlignConverter.cs
- COM2PictureConverter.cs
- remotingproxy.cs
- UncommonField.cs
- TableItemStyle.cs
- TimelineClockCollection.cs
- EventListenerClientSide.cs
- xmlglyphRunInfo.cs
- BinaryWriter.cs
- DataGridColumnEventArgs.cs
- BoolExpr.cs
- WSDualHttpBinding.cs
- AsyncOperationLifetimeManager.cs
- AdapterUtil.cs
- DateTimeFormat.cs
- DrawingState.cs
- SolidBrush.cs
- QueryStringConverter.cs
- EntityModelBuildProvider.cs