Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- QuaternionKeyFrameCollection.cs
- NominalTypeEliminator.cs
- DesignTimeSiteMapProvider.cs
- WebBrowserContainer.cs
- AdornedElementPlaceholder.cs
- Stackframe.cs
- MonitorWrapper.cs
- ProcessHostServerConfig.cs
- IxmlLineInfo.cs
- DataBindingCollection.cs
- Effect.cs
- ConnectionStringSettingsCollection.cs
- AccessDataSourceView.cs
- Message.cs
- DocumentPaginator.cs
- UnsafeNativeMethods.cs
- BitmapEffectDrawingContextWalker.cs
- DesignOnlyAttribute.cs
- NetworkInterface.cs
- Translator.cs
- DBCommandBuilder.cs
- SqlDataSourceSelectingEventArgs.cs
- TargetControlTypeCache.cs
- Condition.cs
- DelegateSerializationHolder.cs
- HttpHandlerActionCollection.cs
- JsonServiceDocumentSerializer.cs
- OrthographicCamera.cs
- TabItemWrapperAutomationPeer.cs
- EncoderBestFitFallback.cs
- DelegatingConfigHost.cs
- PackageRelationshipSelector.cs
- SqlDelegatedTransaction.cs
- ChannelManager.cs
- Dump.cs
- TagPrefixInfo.cs
- ChtmlTextWriter.cs
- CodeGroup.cs
- GeometryCombineModeValidation.cs
- DesignerTransactionCloseEvent.cs
- ThemeDictionaryExtension.cs
- OpenTypeLayout.cs
- ProjectedWrapper.cs
- TraceFilter.cs
- HwndHostAutomationPeer.cs
- PauseStoryboard.cs
- ColorTypeConverter.cs
- MessageQueue.cs
- ZoneLinkButton.cs
- TreeViewImageKeyConverter.cs
- Convert.cs
- EpmSyndicationContentDeSerializer.cs
- SystemIPv6InterfaceProperties.cs
- TraceSection.cs
- MethodImplAttribute.cs
- DataTable.cs
- SymDocumentType.cs
- PerfService.cs
- ConnectionProviderAttribute.cs
- DrawingContext.cs
- FocusChangedEventArgs.cs
- WrapPanel.cs
- XmlSerializerFactory.cs
- UdpDuplexChannel.cs
- SwitchAttribute.cs
- SQLByteStorage.cs
- ImplicitInputBrush.cs
- CompilerParameters.cs
- TraceListener.cs
- WebBrowserContainer.cs
- ContractHandle.cs
- BitmapInitialize.cs
- ListenerBinder.cs
- IdentityModelDictionary.cs
- ToolStripItemClickedEventArgs.cs
- LogicalExpr.cs
- BindingSource.cs
- XmlNode.cs
- FormsAuthentication.cs
- documentsequencetextview.cs
- ADMembershipUser.cs
- CustomTypeDescriptor.cs
- TrustManager.cs
- SimpleWebHandlerParser.cs
- ControlPropertyNameConverter.cs
- MenuItemCollection.cs
- FieldBuilder.cs
- ListDictionary.cs
- HttpModulesSection.cs
- JulianCalendar.cs
- D3DImage.cs
- EventDescriptorCollection.cs
- ThicknessAnimation.cs
- ContextMenu.cs
- SingleAnimationUsingKeyFrames.cs
- DataGridViewCheckBoxCell.cs
- Wow64ConfigurationLoader.cs
- SvcMapFile.cs
- CqlErrorHelper.cs
- SmtpReplyReader.cs