Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- FaultDesigner.cs
- AppLevelCompilationSectionCache.cs
- RpcAsyncResult.cs
- ChannelListenerBase.cs
- DocumentScope.cs
- AppDomainAttributes.cs
- ThreadStaticAttribute.cs
- MimeObjectFactory.cs
- WebPartsPersonalizationAuthorization.cs
- EnterpriseServicesHelper.cs
- MappingItemCollection.cs
- DesignTimeValidationFeature.cs
- ConnectionsZone.cs
- DependencyPropertyDescriptor.cs
- SqlUserDefinedTypeAttribute.cs
- AnnotationResource.cs
- ConvertersCollection.cs
- NumericUpDown.cs
- ToolBarButton.cs
- ZoomingMessageFilter.cs
- RtfToken.cs
- COM2PropertyDescriptor.cs
- DataServiceException.cs
- SaveWorkflowAsyncResult.cs
- PeerNameResolver.cs
- WebBrowsableAttribute.cs
- QilGenerator.cs
- StandardCommands.cs
- ScrollChrome.cs
- ContainerActivationHelper.cs
- TextReader.cs
- XsltArgumentList.cs
- XmlQualifiedName.cs
- ToolStripStatusLabel.cs
- XamlInt32CollectionSerializer.cs
- ExtendedPropertyCollection.cs
- StrokeCollection2.cs
- ValidationErrorCollection.cs
- InvalidateEvent.cs
- LambdaCompiler.Generated.cs
- BindingsCollection.cs
- SectionXmlInfo.cs
- ResourceDescriptionAttribute.cs
- CompilationLock.cs
- PermissionRequestEvidence.cs
- CacheMode.cs
- SupportsEventValidationAttribute.cs
- HandlerMappingMemo.cs
- HttpInputStream.cs
- FormView.cs
- EncoderFallback.cs
- Pair.cs
- ActiveXContainer.cs
- LinqDataSourceUpdateEventArgs.cs
- ElementsClipboardData.cs
- HashLookup.cs
- InfoCardCryptoHelper.cs
- HuffmanTree.cs
- Rectangle.cs
- ProfilePropertyMetadata.cs
- DataSourceExpressionCollection.cs
- QuaternionAnimationBase.cs
- AssemblyCollection.cs
- ToolboxItemCollection.cs
- GenericXmlSecurityToken.cs
- DateTimeConverter2.cs
- RoutedUICommand.cs
- ServiceBehaviorElementCollection.cs
- PerformanceCounterPermissionEntryCollection.cs
- TextTreeNode.cs
- SqlBuffer.cs
- MsdtcClusterUtils.cs
- DataGridCellEditEndingEventArgs.cs
- DependencyProperty.cs
- _CacheStreams.cs
- DataGridViewRowConverter.cs
- RegularExpressionValidator.cs
- ComboBoxItem.cs
- EventLogPermissionEntry.cs
- XmlSiteMapProvider.cs
- GeometryModel3D.cs
- ObjectDataSourceView.cs
- QueryCreatedEventArgs.cs
- ValidationErrorCollection.cs
- ScriptReferenceEventArgs.cs
- AspNetHostingPermission.cs
- Shape.cs
- SerialReceived.cs
- CodeObjectCreateExpression.cs
- _UriSyntax.cs
- CompressStream.cs
- DataBindingList.cs
- SelectionManager.cs
- DomainLiteralReader.cs
- AppDomainAttributes.cs
- DocumentCollection.cs
- FreezableDefaultValueFactory.cs
- PassportAuthenticationModule.cs
- ProxyGenerator.cs
- DataGridViewCellFormattingEventArgs.cs