Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / XamlDesignerSerializationManager.cs / 1305600 / 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
- BufferModesCollection.cs
- LogEntrySerializationException.cs
- UidManager.cs
- CryptoApi.cs
- X509DefaultServiceCertificateElement.cs
- KeyboardDevice.cs
- RC2.cs
- SubstitutionDesigner.cs
- FreeFormDragDropManager.cs
- MemberDescriptor.cs
- ExportException.cs
- PathHelper.cs
- RijndaelManagedTransform.cs
- SafeRightsManagementQueryHandle.cs
- SID.cs
- BindingGraph.cs
- DataBoundControlAdapter.cs
- ParserExtension.cs
- EventListenerClientSide.cs
- LockRecoveryTask.cs
- infer.cs
- ConnectionManagementElement.cs
- XsltLibrary.cs
- TextSegment.cs
- ObjectListDataBindEventArgs.cs
- SelectorAutomationPeer.cs
- PropertyChangeTracker.cs
- DBSqlParserTableCollection.cs
- SubqueryRules.cs
- ThreadAbortException.cs
- RowTypePropertyElement.cs
- ExtensionQuery.cs
- AdCreatedEventArgs.cs
- GifBitmapEncoder.cs
- MailWriter.cs
- XhtmlBasicTextBoxAdapter.cs
- XmlLoader.cs
- BasicHttpSecurity.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- ContextStaticAttribute.cs
- TreeNodeStyle.cs
- XPathBinder.cs
- ClientSettingsProvider.cs
- ExecutionEngineException.cs
- OleDbMetaDataFactory.cs
- ParagraphVisual.cs
- Oid.cs
- SiteMapNodeCollection.cs
- MemberInfoSerializationHolder.cs
- Operators.cs
- XmlText.cs
- SystemIcons.cs
- BoolExpressionVisitors.cs
- CodeIndexerExpression.cs
- WebPartAuthorizationEventArgs.cs
- PrintingPermissionAttribute.cs
- SR.cs
- GridViewHeaderRowPresenter.cs
- UnsafeCollabNativeMethods.cs
- ImageSource.cs
- Accessible.cs
- PolicyDesigner.cs
- ReadContentAsBinaryHelper.cs
- BitmapCodecInfo.cs
- Rect.cs
- MessageHeaderT.cs
- ToolStripPanelSelectionGlyph.cs
- TypeNameConverter.cs
- ActivityCodeDomSerializer.cs
- odbcmetadatacollectionnames.cs
- ControlCodeDomSerializer.cs
- ScriptDescriptor.cs
- GridViewHeaderRowPresenter.cs
- CreateRefExpr.cs
- WindowsPen.cs
- XmlSchemaSimpleContent.cs
- ADConnectionHelper.cs
- WindowsFormsDesignerOptionService.cs
- _AutoWebProxyScriptEngine.cs
- ErrorStyle.cs
- ProviderException.cs
- HybridDictionary.cs
- ColorContext.cs
- ProgressChangedEventArgs.cs
- FastEncoder.cs
- CapabilitiesSection.cs
- SectionInput.cs
- InternalPermissions.cs
- TransformGroup.cs
- LogLogRecord.cs
- EncodingTable.cs
- DateTimeUtil.cs
- DBPropSet.cs
- ListViewUpdatedEventArgs.cs
- Selector.cs
- HostProtectionPermission.cs
- DataGridLinkButton.cs
- XmlILTrace.cs
- _LocalDataStore.cs
- SecurityDescriptor.cs