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
- StyleCollectionEditor.cs
- PopupRootAutomationPeer.cs
- WindowsGraphics.cs
- RemoveStoryboard.cs
- RootAction.cs
- DataSourceHelper.cs
- Process.cs
- EditorAttribute.cs
- SiteMap.cs
- ActionFrame.cs
- FixedTextSelectionProcessor.cs
- UIElement3D.cs
- SecurityStateEncoder.cs
- XmlArrayItemAttributes.cs
- DocumentPageTextView.cs
- UInt16.cs
- OutputCacheProfile.cs
- ActivationServices.cs
- EditorZone.cs
- FontFaceLayoutInfo.cs
- GenericUI.cs
- ThemeInfoAttribute.cs
- CodeGroup.cs
- ExtractedStateEntry.cs
- CompositionTarget.cs
- WebPartTransformer.cs
- BaseUriHelper.cs
- SnapshotChangeTrackingStrategy.cs
- SqlDataSourceCommandParser.cs
- TriggerCollection.cs
- Visitors.cs
- WpfSharedXamlSchemaContext.cs
- AttributeCollection.cs
- RectangleGeometry.cs
- TimerElapsedEvenArgs.cs
- RegisteredExpandoAttribute.cs
- SqlDataSourceCache.cs
- SqlClientWrapperSmiStream.cs
- BamlVersionHeader.cs
- RemotingConfigParser.cs
- InvalidDataContractException.cs
- EditorZone.cs
- ISAPIRuntime.cs
- Renderer.cs
- DataGridViewRowPrePaintEventArgs.cs
- CompModHelpers.cs
- CompoundFileReference.cs
- MimeWriter.cs
- SqlDataSourceView.cs
- Preprocessor.cs
- TextContainerHelper.cs
- KeyInstance.cs
- OracleMonthSpan.cs
- MenuItem.cs
- AsyncSerializedWorker.cs
- WindowInteropHelper.cs
- GACMembershipCondition.cs
- PeerNameRecordCollection.cs
- SQLDateTimeStorage.cs
- FieldNameLookup.cs
- WorkflowOperationBehavior.cs
- SqlServices.cs
- FormsAuthenticationUserCollection.cs
- x509utils.cs
- WindowShowOrOpenTracker.cs
- SqlServer2KCompatibilityAnnotation.cs
- FlowDocumentPaginator.cs
- EncoderBestFitFallback.cs
- JpegBitmapDecoder.cs
- _SSPIWrapper.cs
- FeatureSupport.cs
- Viewport3DAutomationPeer.cs
- BypassElementCollection.cs
- SqlUDTStorage.cs
- SqlBinder.cs
- HttpVersion.cs
- StrokeNodeData.cs
- XmlSchemaGroup.cs
- AttributeUsageAttribute.cs
- figurelengthconverter.cs
- XMLDiffLoader.cs
- LicenseException.cs
- ExpressionNode.cs
- XmlSchemaImport.cs
- DataPager.cs
- COM2PropertyPageUITypeConverter.cs
- QuaternionValueSerializer.cs
- PointConverter.cs
- SelectionHighlightInfo.cs
- AuthenticationConfig.cs
- CommandTreeTypeHelper.cs
- HtmlContainerControl.cs
- EdmScalarPropertyAttribute.cs
- NameService.cs
- ActionItem.cs
- CacheSection.cs
- AsyncResult.cs
- ColumnBinding.cs
- XmlTextReaderImplHelpers.cs
- CodeSubDirectoriesCollection.cs