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
- PropertyRef.cs
- BaseInfoTable.cs
- unitconverter.cs
- DataColumn.cs
- HostTimeoutsElement.cs
- RtType.cs
- ProfilePropertyMetadata.cs
- HttpCacheVary.cs
- SecUtil.cs
- COAUTHINFO.cs
- StorageComplexPropertyMapping.cs
- BooleanStorage.cs
- XmlILCommand.cs
- EventToken.cs
- FormViewUpdatedEventArgs.cs
- LZCodec.cs
- DesigntimeLicenseContextSerializer.cs
- LinkArea.cs
- FixedPage.cs
- SimpleWebHandlerParser.cs
- ObjectTag.cs
- MethodBuilderInstantiation.cs
- GridErrorDlg.cs
- ContentElement.cs
- SpellerInterop.cs
- SchemaEntity.cs
- CodeCompileUnit.cs
- SequentialUshortCollection.cs
- Variable.cs
- SqlWorkflowInstanceStoreLock.cs
- UnmanagedMarshal.cs
- EncoderBestFitFallback.cs
- HtmlContainerControl.cs
- SoapTypeAttribute.cs
- Profiler.cs
- TypeContext.cs
- NegotiateStream.cs
- SqlTriggerAttribute.cs
- AnimatedTypeHelpers.cs
- XmlDocumentSchema.cs
- DLinqDataModelProvider.cs
- XmlSchemaAttribute.cs
- Version.cs
- InternalConfigRoot.cs
- TextEditorDragDrop.cs
- DbProviderSpecificTypePropertyAttribute.cs
- XPathNodeInfoAtom.cs
- DisplayMemberTemplateSelector.cs
- CapabilitiesRule.cs
- CodeStatementCollection.cs
- COM2FontConverter.cs
- DataGridLengthConverter.cs
- DataRecordObjectView.cs
- CaseInsensitiveHashCodeProvider.cs
- WebPartDisplayMode.cs
- WebServiceMethodData.cs
- ServiceNotStartedException.cs
- PreviewKeyDownEventArgs.cs
- smtpconnection.cs
- XhtmlBasicCommandAdapter.cs
- SessionStateModule.cs
- OperationExecutionFault.cs
- ConfigPathUtility.cs
- DataBindEngine.cs
- SqlDelegatedTransaction.cs
- EditBehavior.cs
- StringStorage.cs
- QuaternionAnimation.cs
- Sequence.cs
- TextServicesDisplayAttributePropertyRanges.cs
- DeclarativeCatalogPart.cs
- LocatorManager.cs
- ToolboxComponentsCreatingEventArgs.cs
- PermissionListSet.cs
- WinFormsSecurity.cs
- NullExtension.cs
- ElementsClipboardData.cs
- LocatorGroup.cs
- CustomSignedXml.cs
- ControlEvent.cs
- DesignerActionGlyph.cs
- RelationshipEndCollection.cs
- UTF8Encoding.cs
- EncoderNLS.cs
- ProfileModule.cs
- DictionaryMarkupSerializer.cs
- TraceHandlerErrorFormatter.cs
- DefinitionUpdate.cs
- DecoderBestFitFallback.cs
- StrongNameUtility.cs
- NamespaceEmitter.cs
- PropertyPathWorker.cs
- Column.cs
- codemethodreferenceexpression.cs
- ApplicationSettingsBase.cs
- PersistNameAttribute.cs
- BaseHashHelper.cs
- X509CertificateInitiatorClientCredential.cs
- StylusPointDescription.cs
- Panel.cs